I'm working on a C++ client application that uses OpenSSL to secure
the communication with a server.

I got some pretty weird error when deploying on a client's machine.
From their feedback and from the logs it appears that SSL_connect
always blocks for about 40 seconds while hogging the CPU ( it stays
constantly at 100% ) and than fails. The server then gets a read
timeout. What's even more puzzling to me is that subsequent retries of
SSL_connect succeed without taking so much time or hogging the CPU. So
this problem appears only on the first call to SSL_connect after I
start the client application.

Basically, what the client app does is this:

[init a blocking WINSOCK called fd]

SSL_library_init();
SSL_load_error_strings();
SSLeay_add_all_algorithms();

SSL_METHOD * meth = SSLv3_client_method ();
ctx_ = SSL_CTX_new ( meth );
SSL_CTX_set_mode( ctx_, SSL_MODE_AUTO_RETRY );
ssl_ = SSL_new ( ctx_ );
SSL_set_connect_state(ssl_);
SSL_set_fd ( ssl_, sd_ );
err = SSL_connect ( ssl_ );


Both the client app and the server are running on the same Windows
machine. On the client I'm using OpenSSL 0.9.6 and the server is coded
in Java and uses javax.net.ssl.SSLSocket.

Does anyone have any idea what might cause SSL_connect to behave like
this? Any help would be greatly appreciated.

--
The world is a tragedy to those who feel, but a comedy to those who
think.(Horace Walpole)
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to