Hi,
 
I have a client program using Openssl to send request to and receive response from a web server. SSL_read hangs if the web server sends the following headers.
 
The following is the header dump without SSL. I think the problem is the separator 0d 0a 0d 0a between the two block of headers.
 
0x00000000 | 48 54 54 50 2f 31 2e 31 20 31 30 30 20 43 6f 6e |HTTP/1.1 100 Con
0x00000010 | 74 69 6e 75 65 0d 0a 53 65 72 76 65 72 3a 20 4d |tinue..Server: M
0x00000020 | 69 63 72 6f 73 6f 66 74 2d 49 49 53 2f 35 2e 30 |icrosoft-IIS/5.0
0x00000030 | 0d 0a 44 61 74 65 3a 20 57 65 64 2c 20 33 30 20 | ..Date:Wed, 30
0x00000040 | 4f 63 74 20 32 30 30 32 20 30 36 3a 33 34 3a 35 | Oct 2002 06:34:5
0x00000050 | 36 20 47 4d 54 0d 0a 0d 0a                      | 6 GMT....

0x00000000 | 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d |HTTP/1.1 200 OK.
0x00000010 | 0a 53 65 72 76 65 72 3a 20 4d 69 63 72 6f 73 6f |.Server: Microso
0x00000020 | 66 74 2d 49 49 53 2f 35 2e 30 0d 0a 44 61 74 65 |ft-IIS/5.0..Date
0x00000030 | 3a 20 57 65 64 2c 20 33 30 20 4f 63 74 20 32 30 | : Wed,30 Oct 20
0x00000040 | 30 32 20 30 36 3a 33 35 3a 30 37 20 47 4d 54 0d | 02 06:35:07 GMT.
0x00000050 | 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a |.Content-Length:
0x00000060 | 20 31 38 36 33 0d 0a 43 6f 6e 74 65 6e 74 2d 54 |1863..Content-T
0x00000070 | 79 70 65 3a 20 74 65 78 74 2f 68 74 6d 6c 0d 0a | ype:text/html..
0x00000080 | 45 78 70 69 72 65 73 3a 20 57 65 64 2c 20 33 30 |Expires: Wed, 30
0x00000090 | 20 4f 63 74 20 32 30 30 32 20 30 36 3a 33 35 3a |  Oct 2002 06:35:
0x000000a0 | 30 37 20 47 4d 54 0d 0a 43 61 63 68 65 2d 63 6f | 07 GMT..Cache-co
0x000000b0 | 6e 74 72 6f 6c 3a 20 70 72 69 76 61 74 65 0d 0a | ntrol: private..
 
You can see, it is like
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.0
Date: Wed,  30 Oct 2002 06:34:56 GMT
0d 0a 0d 0a
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Wed,  30 Oct 2002 06:34:56 GMT
Content-Length: 1863
.....
 
There is separator 0d 0a 0d 0a between the two block of headers. My program just stuck in the separator and couldn't get the following HTTP/1.1 200 OK ... 
 
If I change it to non-blocking, SSL_read() doesn't hang any more, but it keep getting SSL_ERROR_WANT_READ error, if I keeping SSL_read, it keep getting SSL_ERROR_WANT_READ and doesn't return valid data.
 
Can anyone help me on this? I tried to post message on diferent site in the last two weeks and didn't get much response.
 
Thanks
 
Lin
 

Reply via email to