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?
Not to my knowledge. I've been using OpenSSL for about 1 year now in a
multi-threaded application without any problems and special precautions.
> What about my callbacks for cert verification etc?
> Do I have to create several CTX objects?
No. You can set-up one original CTX and use this as context for several
connections. One caveat: each CTX is tied to specific SSL-connection.
Therefore you can have several (logical) connection via this CTX, but
they will all yield the same information about certs etc.
If you need to have different certs or connections to several hosts, you
need to set up individual CTXs.
Mind you, this is based on knowledge what appears to work. I do not
claim that this is the way it _should_ work or the way it was _designed_
to work. This is left to our gurus. Maybe they'll comment if I've said
something exceptionally stupid.
HTH,
Hannes
--
Hannes Reinecke <[EMAIL PROTECTED]>
Fluid Loading and Instrumentation Center Tel: (+44) 131 451 3149
Dept. of Civil & Offshore Engineering Fax: (+44) 131 451 3154
Heriot Watt University, Edinburgh EH14 4AS
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]