#553 SecureSocketImpl::connect hangs

Platform_Specific
closed
nobody
Net (141)
5
2012-11-10
2012-07-28
Takashi Sakamoto
No

Environment
 OS:Red Hat Enterprise Linux Server release 5.5
 GCC:4.1.2 20080704
 OpenSSL:0.9.8e

May be hung in SSL_connect of OpenSSL.
The stack trace is as follows.

Thread 36 (Thread 0xe15c6b90 (LWP 27752)):

0 0xffffe410 in __kernel_vsyscall ()

1 0x005e5afb in read () from /lib/libpthread.so.0

2 0x0015bc57 in ?? () from /lib/libcrypto.so.6

3 0x00159db1 in BIO_read () from /lib/libcrypto.so.6

4 0xf7680aeb in ssl23_read_bytes () from /lib/libssl.so.6

5 0xf767fcb2 in ssl23_connect () from /lib/libssl.so.6

6 0xf768bc0a in SSL_connect () from /lib/libssl.so.6

7 0xf7b1aca1 in Poco::Net::SecureSocketImpl::connectSSL(bool) () from /usr/local/lib/libPocoNetSSLd.so.11

8 0xf7b1ae48 in Poco::Net::SecureSocketImpl::connect(Poco::Net::SocketAddress const&, Poco::Timespan const&, bool) () from /usr/local/lib/libPocoNetSSLd.so.11

Occur when a fault occurs in a network between the SSL_connect from connect.
I believe that must be corrected as follows.

void SecureSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout, bool performHandshake)
{
if (_pSSL) reset();

poco_assert (!_pSSL);

_pSocket->connect(address, timeout);
_pSocket->setReceiveTimeout( timeout );  <- Add This Line
_pSocket->setSendTimeout( timeout );      <- Add This Line
connectSSL(performHandshake);

}

thnks.

Discussion

  • Pavel Punsky
    Pavel Punsky
    2012-08-04

    I experience the same issue on Windows Server 2008 R2. Did the same fix - set send AND receive timeouts. I'm using OpenSSL 1.0.1c while connecting to IIS 7.0

     
  • fixed in 1.4.4, rev. 1913

     
    • status: open --> closed