cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem using FTPS through HTTP Proxy (crash in cURL library)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 13 Sep 2006 13:01:59 +0200 (CEST)

On Wed, 13 Sep 2006, Robert Gonzalez wrote:

> - if (conn->ssl[num].use)
> + if (conn->ssl[num].use && conn->ssl[num].handle != 0)

Yes, I think this fixes the problem for you, in the short term at least. But
here are 2 additional points to consider:

1 - this doesn't work if you build libcurl without SSL support, as then
     there's no such 'handle' struct member

and perhaps more importantly (since the above could be fixed with a more or
less ugly #ifdef)

2 - if you build SSL support with GnuTLS instead of OpenSSL there's no handle
     either, but instead the negotiated SSL state is kept differently

So my suggestion on a proper fix would be something in this style:

We add a new field in that struct called something like 'want' meaning that it
is true when the connection _wants_ SSL rather than it already uses it since
like in this case it clearly doesn't use it to start with.

We keep the 'use' field and make sure it only is true when we truly use SSL on
the connection.

Then all we need to fix is to make sure 'use' is FALSE as long as no SSL
negotiation has been performed, and if 'want' is TRUE it will SSL negotiate
and when that is completed 'use' is set TRUE and all is fine again.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-09-13