I'm new to sockets programming and OpenSSL so I'm expecting this to be a mistake on my part.

Most the time I'm able to setup basic SSL comms without a problem, pretty much following the code in the OpenSSL book. However I've been running some tests with a lot of repeated open/closing of connections and every now and then the call to BIO_do_connect fails (returns -1). This wouldn't be a problem, just try the connection again, but I find that retries will fail for about the next minute, even if I restart both the server and client apps in this test setup.

I must be missing out some connection closing/flushing or something. Or is it that too many connections in a short time frame overwhelms Window's networking system in some way, locking it out for a minute.

SSL_error_string gives "error:02002740:system library:connect:reason(1856)"

Sample client code:
// Connect
m_BIO = BIO_new_connect("127.0.0.1:7777");
BIO_do_connect(m_BIO);   // Returns -1
m_SSL = SSL_new(ctx);
SSL_set_bio(m_SSL, m_BIO, m_BIO);
SSL_connect(m_SSL);

// Do stuff...

// Disconnect, am I missing anything?
if(SSL_get_shutdown(m_SSL) & SSL_RECEIVED_SHUTDOWN)
   SSL_shutdown(m_SSL);
else
   SSL_clear(m_SSL);
SSL_free(m_SSL);

This behaviour happens on WinXP and Win2K PCs, using OpenSSL 0.9.7c all compiled with VC++ 7.1.

Scott


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

Reply via email to