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,
Add to your connection setup code:
// Make sure this is NOT a stack variable! The buffer
// must be available through whole live of the connection
char buffer[CURL_ERROR_SIZE+1] = {};
retCode=curl_easy_setopt(handleCurl, CURLOPT_ERRORBUFFER, buffer);
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 CURLcode
is always returned by curl_easy_perform
for easy handles.
If you use multi handles, use curl_multi_info_read
instead. Here is example:
int u = 0;
if (CURLM_OK == curl_multi_perform(multi_, &u))
{
int q = 0;
CURLMsg *msg = NULL;
while ((msg = curl_multi_info_read(multi_, &q)) != NULL)
{
if (msg->msg == CURLMSG_DONE)
{
CURL* easy = msg->easy_handle;
CURLcode code = msg->data.result;
// . . .
}
}
}