cURL
Haxx ad
libcurl

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

Libcurl stops when sending lots of https messages

From: L S <zorkulus_at_hotmail.com>
Date: Wed, 4 Nov 2009 15:06:56 +0100

Hi

I'm writing a multi threaded application that sends https messages to a server.
To keep it simple I use libcurl ( version curl-7.19.7 compiled with openSSL-0.9.8h) and the application runs on a Windows XP platform.

Everything works just fine until i raise the number of messages sent per second. Then it sometimes stops in the middle of a message. The progress callback tells me that libcurl is finished sending the message to the server and waits for it's response which never occur. At this point one might blame the server for not responding the client correctly. But the server works just fine when using an old version of the application that doesn't use libcurl ( but still uses openSSL ).

After investigating the problem with wireshark it seems that the server sends an "Encrypted handshake message" to the client after the client is done sending. When everything works out ok libcurl responds with another "Encrypted handshake message" and the server starts sending a response.

 But in the cases when the send stops this "Encrypted handshake message" reply isn't sent. See wireshark output ( when this is recorded only one thread is used to avoid multi thread related issues. ):

Successful:
13987 14.182786 192.168.34.170 192.168.34.171 TLSv1 Client Hello
13988 14.183235 192.168.34.171 192.168.34.170 TLSv1 Server Hello, Certificate, Server Hello Done
13989 14.184825 192.168.34.170 192.168.34.171 TLSv1 Client Key Exchange, Change Cipher Spec, Encrypted Handshake Message
13990 14.188186 192.168.34.171 192.168.34.170 TLSv1 Change Cipher Spec, Encrypted Handshake Message
13991 14.188537 192.168.34.170 192.168.34.171 TLSv1 Application Data
13992 14.189446 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
13993 14.189473 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
13994 14.189490 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
13995 14.189618 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=1228 Ack=3398 Win=62780 Len=0
13996 14.189647 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
13997 14.189666 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
13998 14.189684 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
13999 14.189701 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14000 14.189769 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=1228 Ack=10698 Win=55480 Len=0
14001 14.189787 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14002 14.189815 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14003 14.189829 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14004 14.189846 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14005 14.189861 192.168.34.170 192.168.34.171 TLSv1 Application Data
14006 14.189917 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=1228 Ack=16891 Win=49287 Len=0
14007 14.190004 192.168.34.171 192.168.34.170 TCP [TCP Window Update] https > stun-p3 [ACK] Seq=1228 Ack=16891 Win=64240 Len=0
14008 14.190503 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14009 14.190519 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14010 14.190534 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14011 14.190549 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14012 14.190562 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14013 14.190569 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=1228 Ack=21271 Win=59860 Len=0
14014 14.190578 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14015 14.190596 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14016 14.190612 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14017 14.190618 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=1228 Ack=25651 Win=55480 Len=0
14018 14.190626 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14019 14.190642 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14020 14.190658 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14021 14.190666 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=1228 Ack=30031 Win=51100 Len=0
14022 14.190671 192.168.34.170 192.168.34.171 TLSv1 Application Data
14023 14.190711 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=1228 Ack=33304 Win=47827 Len=0
14024 14.191435 192.168.34.171 192.168.34.170 TCP [TCP Window Update] https > stun-p3 [ACK] Seq=1228 Ack=33304 Win=64240 Len=0
14025 14.191469 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14026 14.191485 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14027 14.191500 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14028 14.191516 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14029 14.191530 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14030 14.191544 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=1228 Ack=37684 Win=59860 Len=0
14031 14.191545 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14032 14.191574 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14033 14.191586 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14034 14.191599 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14035 14.191611 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14036 14.191620 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=1228 Ack=43524 Win=54020 Len=0
14037 14.191625 192.168.34.170 192.168.34.171 TLSv1 Application Data
14038 14.191678 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=1228 Ack=48589 Win=48955 Len=0
14039 14.192933 192.168.34.171 192.168.34.170 TCP [TCP Window Update] https > stun-p3 [ACK] Seq=1228 Ack=48589 Win=64240 Len=0
14040 14.194473 192.168.34.171 192.168.34.170 TLSv1 Encrypted Handshake Message
14041 14.194628 192.168.34.170 192.168.34.171 TLSv1 Encrypted Handshake Message
14042 14.195290 192.168.34.171 192.168.34.170 TCP [TCP segment of a reassembled PDU]
14043 14.195366 192.168.34.171 192.168.34.170 TCP [TCP segment of a reassembled PDU]
14044 14.195384 192.168.34.170 192.168.34.171 TCP stun-p3 > https [ACK] Seq=48682 Ack=4185 Win=65535 Len=0
14045 14.195461 192.168.34.171 192.168.34.170 TCP [TCP segment of a reassembled PDU]
14046 14.195510 192.168.34.170 192.168.34.171 TCP stun-p3 > https [ACK] Seq=48682 Ack=5645 Win=65535 Len=0
14047 14.195572 192.168.34.171 192.168.34.170 TLSv1 Encrypted Handshake Message
14048 14.200710 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
14049 14.200739 192.168.34.170 192.168.34.171 TLSv1 Encrypted Handshake Message, Encrypted Handshake Message, Encrypted Handshake Message, Change Cipher Spec, Encrypted Handshake Message
14050 14.200958 192.168.34.171 192.168.34.170 TCP https > stun-p3 [ACK] Seq=5646 Ack=51115 Win=63267 Len=0
14051 14.204033 192.168.34.171 192.168.34.170 TLSv1 Change Cipher Spec, Encrypted Handshake Message
14052 14.211612 192.168.34.171 192.168.34.170 TCP [TCP segment of a reassembled PDU]
14053 14.211690 192.168.34.170 192.168.34.171 TCP stun-p3 > https [ACK] Seq=51115 Ack=7180 Win=65535 Len=0

and so on until the server is done sending the response.

Failed:
52108 38.147690 192.168.34.170 192.168.34.171 SSL Client Hello
52109 38.148347 192.168.34.171 192.168.34.170 TLSv1 Server Hello, Certificate, Server Hello Done
52110 38.150278 192.168.34.170 192.168.34.171 TLSv1 Client Key Exchange, Change Cipher Spec, Encrypted Handshake Message
52111 38.153034 192.168.34.171 192.168.34.170 TLSv1 Change Cipher Spec, Encrypted Handshake Message
52112 38.153419 192.168.34.170 192.168.34.171 TLSv1 Application Data
52113 38.154309 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52114 38.154334 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52115 38.154355 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52116 38.154551 192.168.34.171 192.168.34.170 TCP https > iwserver [ACK] Seq=1228 Ack=4858 Win=61320 Len=0
52117 38.154604 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52118 38.154631 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52119 38.154647 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52120 38.154665 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52121 38.154680 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52122 38.155214 192.168.34.171 192.168.34.170 TCP https > iwserver [ACK] Seq=1228 Ack=12158 Win=54020 Len=0
52123 38.155249 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52124 38.155266 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52125 38.155286 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52126 38.155300 192.168.34.170 192.168.34.171 TLSv1 Application Data
52127 38.155392 192.168.34.171 192.168.34.170 TCP https > iwserver [ACK] Seq=1228 Ack=16891 Win=49287 Len=0
52128 38.155499 192.168.34.171 192.168.34.170 TCP [TCP Window Update] https > iwserver [ACK] Seq=1228 Ack=16891 Win=64240 Len=0
52129 38.155662 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52130 38.155678 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52131 38.155693 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52132 38.155708 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52133 38.155721 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52134 38.155735 192.168.34.171 192.168.34.170 TCP https > iwserver [ACK] Seq=1228 Ack=21271 Win=59860 Len=0
52135 38.155735 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52136 38.155749 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52137 38.155763 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52138 38.155779 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52139 38.155794 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52140 38.155807 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52141 38.155821 192.168.34.171 192.168.34.170 TCP https > iwserver [ACK] Seq=1228 Ack=30031 Win=51100 Len=0
52142 38.155837 192.168.34.170 192.168.34.171 TLSv1 Application Data
52143 38.155883 192.168.34.171 192.168.34.170 TCP https > iwserver [ACK] Seq=1228 Ack=33304 Win=47827 Len=0
52144 38.156682 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52145 38.156707 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52146 38.156723 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52147 38.156739 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52148 38.156754 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52149 38.156764 192.168.34.171 192.168.34.170 TCP https > iwserver [ACK] Seq=1228 Ack=37684 Win=43447 Len=0
52150 38.156771 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52151 38.156792 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52152 38.156807 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52153 38.156823 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52154 38.156825 192.168.34.171 192.168.34.170 TCP https > iwserver [ACK] Seq=1228 Ack=42064 Win=39067 Len=0
52155 38.156878 192.168.34.171 192.168.34.170 TCP https > iwserver [ACK] Seq=1228 Ack=46444 Win=34687 Len=0
52156 38.156916 192.168.34.170 192.168.34.171 TCP [TCP segment of a reassembled PDU]
52157 38.156996 192.168.34.170 192.168.34.171 TLSv1 Application Data
52158 38.157245 192.168.34.171 192.168.34.170 TCP https > iwserver [ACK] Seq=1228 Ack=47904 Win=64240 Len=0
52159 38.160178 192.168.34.171 192.168.34.170 TLSv1 Encrypted Handshake Message
52160 38.374081 192.168.34.170 192.168.34.171 TCP iwserver > https [ACK] Seq=48589 Ack=1265 Win=64271 Len=0

And there it ends.

I beleve that the two intresting lines are 14041 in the first example and the missing handshake at line 52160 in the second example.

The server is a virtual mashine running on my computer ( windows server 2003 SE ).

I don't really know if this is a libcurl problem or an openSSL problem. It also might be a faulty implemetation from my side. Is this something you have seen before? Do you how I can fix the problem?
The application continues until libcurl times out or fail due to empty reply from server.

All tips might help me!

Best regards
Ludwig

                                               
Keep your friends updated— even when you’re not signed in.
_________________________________________________________________
Keep your friends updated—even when you’re not signed in.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_5:092010

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-04

These mail archives are generated by hypermail.

donate! Page updated November 16, 2009.
web site info

File upload with ASP.NET