Hello,
> Marek Marcola wrote:
> > You may try:
> >  - set socket fd to non-blocking, 
> >  - use SSL_accept()+select() for timeout
> >  - set socket fd to blocking back
> 
> When you say "use SSL_accept()+select()" what exactly do you mean by that ?
You may call SSL_accept() many times on non-blocked fd to complete
full SSL handshake.
If operation will block, SSL_accept() returns with -1, you call
SSL_get_error() to get real cause and if you will get
SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE you may wait on select()
on fd activity (or drop connection if timeout occurs) and next
retry SSL_accept().
Look at the SSL_accept() man page for some information.
 
> I can test the socket with select() if there is data ready to be 
> received (but not how much), and then call SSL_accept(). But until the 
> data exchange for the handshake hasn't completed yet, the SSL_accept() 
> call won't return.
On non-blocking fd SSL_accept() may return and you may retry to complete
SSL handshake.

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

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

Reply via email to