The SSL_CTX_set_timeout() function does not do what you want. It sets the
lifetime of an SSL session, which is the period during which you can reuse
the pre-master secret and avoid expensive public key crypto ops.
_____________________________________
Greg Stark
Ethentica, Inc.
[EMAIL PROTECTED]
_____________________________________
----- Original Message -----
From: "Rainer Kaufmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 02, 2001 11:34 AM
Subject: 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.
> I.e. connecting to a telnet server with the following code snippet seems
to
> run 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);
>
> // Set timeout according connect timeout ???
> SSL_CTX_set_timeout(m_psscContext, 1);//(ANSWER_TIMEOUT_TIME / 1000) +
4);
>
> // 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);
> ----------------
> SSL_connect never returns, using SSL_CTX_set_timeout did have to effect.
> Please heeeeelp......
>
> 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
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]