Iam trying to implement HTTPS support with the help of curl. Since HTTPS is not thread-safe(bcoz of openSSL), am planning to use mutex in curl call. can anyone advice me whether it is safe to lock and unlock just before and after curl_easy_perform call alone or mutex should be locked before setting the curl-options??
Platform : Linux, Language : C
Thanx in advance.. 🙂
OpenSSL is thread safe as long as you provide it with the callback functions that it needs to create the locks it needs to use if it’s used from multiple threads.
See: http://www.openssl.org/docs/crypto/threads.html
For some OpenSSL and Curl specific thoughts you might try here: http://curl.haxx.se/mail/lib-2009-02/0378.html