curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Error 58 with CURLOPT_SSLCERT

From: Praveen Pvs via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 20 Jun 2019 16:09:24 +0530

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-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-06-20