I am establishing a connection to a secured server over SSL.
Everything works fine, my CAcertificate is well used through
retCode=curl_easy_setopt(handleCurl, CURLOPT_CAINFO, sSSLCertificate);
retCode=curl_easy_setopt(handleCurl, CURLOPT_SSL_VERIFYPEER, 1);
I’m stuck when i try to manage curl errors. Basically i want to be able to be notified when a problem happens with the SSL (wrong cacert.pem, server identity not verified etc).
Nothing happens when CURLOPT_CAINFO is given an empty CAcert, retCode is OK.
I tried to get info after the request with that :
res = curl_easy_getinfo(m_pHandleCurl, CURLINFO_SSL_VERIFYRESULT, &lSSLVerifyResult);
But it always tells me that everithing is fine.
What am i missing ?
Add to your connection setup code:
then when your connection has ended, check what’s in the buffer – you should be able to see some hints regarding SSL state, too. It will be empty if no error occurred.
If you want actual code, numeric
CURLcodeis always returned bycurl_easy_performfor easy handles.If you use multi handles, use
curl_multi_info_readinstead. Here is example: