From c4a694862c69f2b63c6b775cd6fdf1a7afcc0a52 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 22 Sep 2008 20:42:13 +0000 Subject: - Michael Goffioul filed bug report #2107377 "Problem with mutli + GnuTLS + proxy" (http://curl.haxx.se/bug/view.cgi?id=2107377) that showed how a multi interface using program didn't work when built with GnuTLS and a CONNECT request was done over a proxy (basically test 502 over a proxy to a HTTPS site). It turned out the ssl connect function would get called twice which caused the second call to fail. --- lib/http.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/http.c b/lib/http.c index b57d9b592..b60345b08 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1814,6 +1814,13 @@ static CURLcode https_connecting(struct connectdata *conn, bool *done) CURLcode result; DEBUGASSERT((conn) && (conn->protocol & PROT_HTTPS)); + if(conn->ssl[FIRSTSOCKET].use) { + /* in some circumstances, this already has SSL enabled and then we don't + need to connect SSL again */ + *done = TRUE; + return CURLE_OK; + } + /* perform SSL initialization for this socket */ result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, done); if(result) { -- cgit v1.2.3