I think OpenSSL is pretty mt safe.
Basically you have to init/create a lot of "locks" (on NT, it's mutexes) - it's around
20-25,
use CRYPTO_NUM_LOCKS. Then you have to set a "locking callback" with
CRYPTO_set_locking_callback() which should either release or wait for a lock
Take a look at mttest.c (included in OpenSSL) for an example of how to set things up!
BTW, you should be able to use the same SSL_CTX for a bunch of SSL connections where
each SSL
structure is in a separate thread.
--Patrik
Markus Wasserschaff wrote:
> Hi,
>
> is it safe to user OpenSSL in multi-threaded environments? Let's say in my
> application multiple threads setup ssl connections to the same host(or
> different hosts).
> Are there any global data structures that have to be protected or does OpenSSL
> handle everything correctly?
> What about my callbacks for cert verification etc?
> Do I have to create several CTX objects?
>
> What is your experience?
>
> Markus
>
> ____________________________________________________________________
> Get your own FREE, personal Netscape WebMail account today at
>http://webmail.netscape.com.
> ______________________________________________________________________
> OpenSSL Project http://www.openssl.org
> Development Mailing List [EMAIL PROTECTED]
> Automated List Manager [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]