diff --git a/lib/http.c b/lib/http.c index 6d1330c25df9679e18c9cf01374a96104dceff2e..bb0c26e72eb4a16e36c1dc1e3e80cf383e081069 100644 --- a/lib/http.c +++ b/lib/http.c @@ -407,13 +407,13 @@ CURLcode Curl_http_connect(struct connectdata *conn) conn->hostname, conn->remote_port); if(CURLE_OK != result) return result; - - if(conn->protocol & PROT_HTTPS) { - /* now, perform the SSL initialization for this socket */ - result = Curl_SSLConnect(conn); - if(result) - return result; - } + } + + if(conn->protocol & PROT_HTTPS) { + /* now, perform the SSL initialization for this socket */ + result = Curl_SSLConnect(conn); + if(result) + return result; } if(conn->bits.user_passwd && !data->state.this_is_a_follow) {