W3C home > Mailing lists > Public > www-lib@w3.org > April to June 2001

SSL does not work after there has been a timeout

From: <andrew.d.falk@accenture.com>
Date: Tue, 29 May 2001 15:48:24 -0400 (EDT)
To: www-lib@w3.org
Message-ID: <OF4D03BE41.BC064243-ON86256A5B.00679F14@accenture.com>
Hi,
I hope someone can help me.  I'm trying to send data to a secure server and
get data back.  Everything works fine if the server doesn't time timeout.
If it times out, the connected doesn't terminate properly and subsequent
connects fail.  I setup the SSL part by simply adding these lines:

    HTSSL_protMethod_set(HTSSL_V23);
    HTSSL_verifyDepth_set(2);
    HTSSLhttps_init(NO);

I needed to set the set HTSSLhttps_init to NO, otherwise it wouldn't
timeout.  I believe it makes it non-blocking.  I then set my timeout to 2
seconds and make the call:

    HTHost_setEventTimeout(2000);
    chunk = HTLoadToChunk(absolute_url, request);

On the first run it increments the reference count to 2:

HTSSL New... Created new SSL Object d37a0
HTSSL....... Setting up d37a0 on socket 4
HTSSL....... New reference count = 1
SSL_connect: before/connect initialization
SSL_connect: SSLv2/v3 write client hello A
SSL_connect: error in SSLv2/v3 read server hello A
HTSSLWriter. SSL returned 2
HTSSL New... Found SSL d37a0 with sd =  4
HTSSL....... New reference count = 2
SSL_connect: error in SSLv2/v3 read server hello A

It then times out and decrements the reference count by only one:

Request timeout - server did not respond.
HTTPGen..... ABORTING...
HTTPRequest. ABORTING...
Buffer...... ABORTING...
HTSSLWriter. Abort c6610
FileWriter.. ABORTING...
Net Object.. Delete d4780 and call AFTER filters
Host info... Remove d4780 from pipe
Host Object. closing socket 4
Channel..... Semaphore set to 0 for channel d5a90
Timer....... Deleted active timer c6650
Event....... No more events registered for socket 4
Event....... Reset MaxSock from 4 to 1
Event....... Socket 4 unregistered for HTEvent_READ
Event....... Couldn't find socket 4. Can't unregister type HTEvent_WRITE
Channel..... Delete d5a90 with semaphore 0, status -905
Channel..... Delete input stream d7af0 from channel d5a90
HTSSLReader. Abort d7af0
FileWriter.. ABORTING...
Channel..... Delete input stream d7af0 from channel d5a90
Buffer...... ABORTING...
HTSSLWriter. Abort c6610
HTSSLReader. FREEING....
HTSSLWriter. FREEING....
HTSSL Free.. ref_count = 1
Net Manager. Decreasing active sockets to 0, 0 persistent sockets

On the second run it increment the reference by 2 again, making the
reference count equal to 3:

HTSSL New... Found SSL d37a0 with sd =  4
HTSSL....... New reference count = 2
HTSSLWriter. SSL returned 0
HTSSLWriter. 161 bytes written to 4
HTSSL New... Found SSL d37a0 with sd =  4
HTSSL....... New reference count = 3
HTSSLReader. SSL returned 2
HTSSLReader. WOULD BLOCK fd 4

Now, is when there are problems.  It never makes a proper connection to the
server:

HTSSLReader. SSL returned 5
HTSSLReader. FIN received on socket 4
Timer....... Deleted active timer d77a8
Event....... No more events registered for socket 4
Event....... Reset MaxSock from 4 to 1
Event....... Socket 4 unregistered for HTEvent_READ
Event....... Couldn't find socket 4. Can't unregister type HTEvent_WRITE
HTSSL....... Closing SSL Object d37a0
HTSSL Free.. ref_count = 2

The reference count was only decremented by one again.

If anyone could give me some insight on this problem, I would greatly
appreciate it.

Thanks,
Andrew Falk
Received on Wednesday, 30 May 2001 05:59:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:39 GMT