This is a topic for openssl-users.


On Thu, May 03, 2001 at 05:11:42PM +0200, Rainer Kaufmann wrote:
> Hi,
> 
> has somebody an idea to avoid the SSL library to hang in SSL_connect when
> the other side does not respond ?
> Starting a timer and calling SSL_shutdown and closesocket on timeout, causes
> the SSL library to crash :-(
> I think the problem is the library waiting in socket::recv after
> ssl3_get_server_hello when there is nothing to read. A simple socket::select
> would solve this...

Use non-blocking mode. Switch the socket to non-blocking mode
and SSL_connect() will return with _WANT_READ in the case described.
Your application can than select() on the socket and call SSL_connect()
again, when data are available. If not, your application can SSL_free()
and close the socket, when a timeout condition was encountered.

Best regards,
        Lutz
-- 
Lutz Jaenicke                             [EMAIL PROTECTED]
BTU Cottbus               http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik                  Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus              Fax. +49 355 69-4153
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to