Re: Error 58 with CURLOPT_SSLCERT
Date: Thu, 20 Jun 2019 23:50:50 +0530
Hi All,
Have been trying to debug this from yesterday, not able to figure it out.
Can someone help me here!
If i am not getting this to work, need to change my implementation from
Curl library usage to openssl calls.
Appreciate your help and time
Regards
Praveen
On Thu, Jun 20, 2019 at 4:09 PM Praveen Pvs <meetpraveenpvs_at_gmail.com>
wrote:
> Curl Error Buffer: unable to set private key file:
> '/mnt/flash/system/rkeys/usr1/key0.der' type DER
>
> Any reasons why setting the private key failing here!
>
> On Thu, Jun 20, 2019 at 10:08 AM Praveen Pvs <meetpraveenpvs_at_gmail.com>
> wrote:
>
>> Hi,
>>
>> I am experiencing error code 58 when i try to set the SSL certificate in
>> my code.
>>
>> Not sure if i am missing some options settings or problem with the SSL
>> certificate. Could you please let me know if i am doing something wrong?
>>
>> #define CA_CERT_FILE "ca-cert.pem" // Certification file
>>
>> #define SSL_OWN_CERT "/mnt/flash/system/rkeys/usr1/key0.crt"
>> #define SSL_OWN_KEY "/mnt/flash/system/rkeys/usr1/key0.der"
>>
>> std::string path;
>> path.assign("/mnt/flash/userdata/usr1/");
>> std::string certName;
>>
>> certName.assign(path.c_str());
>> certName.append(CA_CERT_FILE);
>>
>> curl_easy_setopt(curlHandle, CURLOPT_SSLCERTTYPE, "DER");
>> curl_easy_setopt(curlHandle, CURLOPT_SSLCERT, SSL_OWN_CERT);
>>
>> curl_easy_setopt(curlHandle, CURLOPT_SSLKEYTYPE, "DER");
>> curl_easy_setopt(curlHandle, CURLOPT_SSLKEY, SSL_OWN_KEY);
>>
>> curl_easy_setopt(curlHandle, CURLOPT_CAINFO,certName.c_str());
>> curl_easy_setopt(curlHandle, CURLOPT_CAPATH, path.c_str());
>>
>> When i do the Curl_easy_perform, its returning 58 error code. Have
>> attached sample certificate and keys file which i am using.
>>
>> Regards
>> Praveen
>>
>
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-06-20