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...

Any ideas ?

Thanks, Rainer


-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]Im Auftrag von Rainer Kaufmann
Gesendet: Mittwoch, 2. Mai 2001 17:34
An: [EMAIL PROTECTED]
Betreff: Ttimeout when trying to connect to an non-SSL port ?


Hi,

me again :-) I'm running into serious problems when trying to connect to a
server which does know nothing about SSL.
Connecting to a telnet server with the following code snippet runs into an
infinite loop.

---------------
  SSL_METHOD* pSSLMeth;
  X509* pcrtCertificate;

  // Should timeout by itself
  if(connect(m_hSocket, psa, sizeof(SOCKADDR)) == SOCKET_ERROR)
  {
    throw "CSSLSocket::Connect";
  }
  pSSLMeth = SSLv3_client_method();
  m_psscContext = SSL_CTX_new (pSSLMeth);

  // Create context and connect file descriptor(handle)
  m_pSSL = SSL_new (m_psscContext);
  ASSERT(m_pSSL != NULL);
  SSL_set_fd(m_pSSL, m_hSocket);
  SSL_connect(m_pSSL);
----------------

Thanks, Rainer


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

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

Reply via email to