cURL / Mailing Lists / curl-library / Single Mail


Re: libcurl hangs in SSL handshake

From: sachin dravid <>
Date: Mon, 13 Jan 2014 22:29:19 +0530

On Mon, Jan 13, 2014 at 8:52 PM, Daniel Stenberg <> wrote:

> On Mon, 13 Jan 2014, sachin dravid wrote:
> I am getting few sockets hangs in SSL handshaking. I am using curl multi
>> interface for HTTP protocol.
> I'm not sure I understand your definition of "hang" here.

Actually the sockets are not getting any activity. So exactly my process
has not hung but I need a socket activity to take an action.

> Are you referring to a socket that libcurl "owns" that you won't get any
> notifications about activities on, possibly because libcurl hasn't given
> you the correct bits to check?

I am not sure that socket fd is wrong, because if so than select() should
have return an error instead timeout. But if you can suggest me any
mechanism to check that I can share the results.

> Curl shows me socket fd is there but select() call give me a timeout. So
>> even I am not able to get out from the loop.
> I have set CURL_CONNECTION_TIMEOUT to 5 minutes and CURL_TIMEOUT to 15
>> minutes. The strange thing is it not even giving me timeout error.
> That does indeed sound bad, but I've not seen it happen. We even have test
> cases to verify connect timeouts during a very slow SSL connect so I think
> it generally works.

This scenario is not something with slow network because here the process
has uploaded ~450GB in ~4 hours. Only 2 of my easy handles got such issue.

> But unless you can provide a recipe for us, I'm not sure what I can do
> about this...

I can understand this is something tricky :). How/what more can I share
with you?
Did you get anything with logs?
Another observation is this issue is coming only with SSL only.
Can large number of easy interfaces be an issue? (10 processes each running
100 easy interfaces in parallel)
Also I am reusing the connections, can this be a problem?

If you can give me any pointer, I can share the code/logs around that.
Kindly help me here as I am stuck in this issue since long time.

Thanks and Regards,

> --
> /
> -------------------------------------------------------------------
> List admin:
> Etiquette:

Thanks and Regards,
Sachin Dravid

List admin:
Received on 2014-01-13