Hello,
>  Prabbu/Marek/Chong
> I have a SSL server application. It creates threads for each client
> connection.
> My server call accept(). After the sock = accept() return, I put SSL on
> sock, spin-off a thread for that client. All socks  share the same 'ctx'
> in the server. How do I lock SSL object 'ctx' properly in this case ??
> Should I generate different 'ctx' for each client, instead of share ??
> Please Help.
Usually SSL_CTX structure is shared between connections, but SSL object
created from SSL_CTX is allocated per connection.
In general all dynamic changes are made in SSL object, on creation
some data are copied from SSL_CTX, some points back but in general
are used most "read-only". But there are some use counters in SSL_CTX
which are incremented on SSL object creation and must be (should be)
secured by locking mechanism. For this purpose setting static
locking callbacks should be enough, but dynamic locking callbacks
may be set too.

Best regards,
-- 
Marek Marcola <[EMAIL PROTECTED]>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to