curl-library
Using certificate from memory
Date: Sun, 28 Dec 2008 09:56:24 +0200 (IST)
Hi guys
Hope you can help me with this issue ...
I have these lines of code: ** loading and verify certificate from file path in my system. **
...
int res;
curl_easy_setopt(curl,CURLOPT_CAINFO, "C://server_verify.crt");
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, TRUE);
ret = curl_easy_perform(curl);
long sslresponseCode = 111;
curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, &sslresponseCode);
if (sslresponseCode != CURLE_OK)
{
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &sslresponseCode);
return false;
}
...
But I have a scenario which my certificate is not in the file but on memory
I am reading the certificate into a buffer
.
My Q is ,
Can I load the certificate to curl structure from memory , instead of using "curl_easy_setopt(curl,CURLOPT_CAINFO, "C://server_wrong.crt"); "
Can you help me with that ?
Thanks
Itay
Received on 2008-12-28