Re: Use SSL in multiple connections

2022-05-11 Thread Matt Caswell




On 11/05/2022 10:05, Souheila Hechaichi wrote:
With my actual configuration, an SSL client established more connections 
with the SSL server. Each process (server or client) creates only one 
thread for Its sockets,  I observe a strange behavior. Some server 
sockets remain blocked on the call of SSL_write even if they are in mode 
non-blocking.


That is very strange.

Side client some sockets loop indefinitely on the call of 
SSL_read that return SSL_ERROR_WANT_READ.


Hence my question:

Is It mandatory to create a thread by connection, or can only one thread 
be used by all the connections?




Either model is acceptable. You can have a single thread managing all of 
your SSL objects, or one thread per SSL object. The main rule is that an 
individual SSL object is not thread-safe, so you cannot share a single 
SSL object between multiple threads without additional locking.


Matt



Best regards;



Use SSL in multiple connections

2022-05-11 Thread Souheila Hechaichi
With my actual configuration, an SSL client established more connections with 
the SSL server. Each process (server or client) creates only one thread for Its 
sockets,  I observe a strange behavior. Some server sockets remain blocked on 
the call of SSL_write even if they are in mode non-blocking. Side client some 
sockets loop indefinitely on the call of SSL_read that return 
SSL_ERROR_WANT_READ.
Hence my question:
Is It mandatory to create a thread by connection, or can only one thread be 
used by all the connections?

Best regards;