cURL / Mailing Lists / curl-library / Single Mail


easier way to set the CA PEM file as a string for libcurl?

From: Bram de Jong <>
Date: Fri, 07 Feb 2014 16:54:47 +0100

Hi Everyone,

First post here, don't shoot me for asking what has probably been asked
for before.

Looking into usage of Lib-CURL for Http(s) calls ( surprise! ;) ). I got
the https peer SSL Certificate Verification working just fine with an
on-disk PEM file and I know about CURLOPT_SSL_CTX_FUNCTION. And yes, I
have seen :-)

However my question is: wouldn't it be awesome to have a slightly easier
way to set the *content* of a PEM file or just one certificate as a
string instead of having to point to it on the file system?

I would even think that giving a file pointer would be just as good as
it would allow the usage of an memory-mapped-file rather than an on-disk
one - but this might be harder (/impossible?) with the current interface (?)

I understand that using CURLOPT_SSL_CTX_FUNCTION this would be possible,
but not knowing enough about OpenSSL means I will probably mess up.


  - Bram

Bram de Jong
Senior Developer
Native Instruments GmbH
List admin:
Received on 2014-02-07