Bodo Moeller wrote:
>
> > Is it possible to make a program that handle two (or more) SSL
> > connection in two differents threads without any problem ?
>
> Yes; without any _known_ problems, at least (some known ones present
> in earlier versions are elimininated in 0.9.3). You have to provide
> some locks to the library (via a callback), and you must provide a
> callback function that returns a thread ID; and you have to make sure
> that when a thread exits it has emptied its OpenSSL error stack (an
> additional possibility for memory leaks that may not be ovious at
> first sight). Look at ssltunnel for an example (some of the things
> ssltunnel does are not thread-safe, as far as I remember, but I think
> the OpenSSL related stuff is correct).
Thank you for your answer. In stunnel, there is a callback example,
with threads that helped me a lot. I have added it to my program, but I
think there is still one problem:
To handle multiple connection simultaneously, I have one "network"
thread, that start the SSL connection when a client connects. After
that, it gives the connection (the SSL*) to another thread and waits for
another client. I think that SSL can't handle this, even with these
callback functions, as it might be using ThreadID to distinguish between
connections when they are lots.
If I'm wrong, please explain me why, thanx,
Patrick.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]