cURL / Mailing Lists / curl-library / Single Mail


Re: Using custom ssl certificate from memory

From: Daniel Stenberg <>
Date: Wed, 5 Mar 2014 17:14:34 +0100 (CET)

On Tue, 4 Mar 2014, Ruslan Gaifulin wrote:

> I created a bundle with mk-ca-bundle named C:\mybundle.cer
> I check it like
> curl_easy_setopt(curl, CURLOPT_CAINFO, "C:\\mybundle.cer");
> curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, true);

I advice you to instead pass a 1L as argument. "true" is not necessarily a
long set to 1.

> And was able to login to the server. Now I need to use certificate info from
> memory i.e. with

You thus want the CA cert from memory (just saying "ssl certificate" is a bit
vague and ambigious). Did you try the example showing this?

> *static CURLcode sslctx_function(CURL * curl, void * sslctx, void *
> parm){ X509_STORE * store; X509 * cert=NULL; BIO * bio;
> std::fstream myfile;"C:\\certdata"); std::string
> certText; std::string line; while(std::getline(myfile, line))

... your source code formatting in a text-only mail client is a bit hard to

List admin:
Received on 2014-03-05