I’m using libcurl 7.26.0 in my C++ application to communicate with server by https protocol. It works correctly but after ~20 minutes connection fails: curl_easy_perform returns CURLE_SSL_CACERT_BADFILE. I make curl_easy_cleanup of session then initialize it in the same way successfully but on curl_easy_perform it fails with the same error. Only restart of application helps.
I’ve checked that *.pem file is present on filesystem and access permissions of application were not changed during its run.
I’m using libcurl 7.26.0, Windows 7 x86, MSVC 2005.
Any help will be highly appreciated.
UPD: Problem reproduces only release mode.
I’m using cURL logging. It is turned on in this way:
curl_easy_setopt(m_curl_session, CURLOPT_DEBUGFUNCTION, curl_debug_trace)At the beginning of the function curl_debug_trace log file is opened by
fopenand at the end it is closed usingfclose. In release mode for some reasons it does not close file and process runs to limit of opened files and cannot open cacert file.The solution is to fopen log file once and leave it opened untill program runs.