curl / Mailing Lists / curl-library / Single Mail

curl-library

Questions regarding curl_easy with SSL and multi threaded

From: Volker Schmid <volker.schmid_at_regify.com>
Date: Tue, 14 Mar 2017 14:57:13 +0100

Hello,

In my software I create a pool of curl-easy handles and re-use them in several threads. On MacOS I have crashes but on Windows and Linux it works fine. I did some research and found the threaded-ssl.c example at https://curl.haxx.se/libcurl/c/threaded-ssl.html.

Now I have several questions for which I do not find answers in the web:

- In general, why is the callback needed? I found https://www.openssl.org/docs/man1.0.2/crypto/threads.html but the explanation is very basic and I do not know if it applies to me. What exactly is the mutex for? And what is to prevent? No SSL handshakes in multiple threads at the same time? Even with different curl handles? During the whole connection or during a specific functionality?

- Why is libcurl not setting and using the OpenSSL callbacks if it is using the libs and it is obviously needed?

- As I use libcurl by loading it from dll/so/dylib I wonder how I can use and set the callbacks for OpenSSL if I do not even have the OpenSSL library opened?

- I wonder about, how to deal with this if libcurl is not using OpenSSL (eg on Windows using schannel and whatever libcurl is using on Linux or MacOS)?

Can you please help me on those topics?

Thank you!

Volker

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-03-14