diff --git lib/url.c lib/url.c
index c107d2c..e35c330 100644
--- lib/url.c
+++ lib/url.c
@@ -3267,19 +3267,21 @@ CURLcode Curl_protocol_connect(struct connectdata *conn,
     if(result)
       return result;
 
-    if(conn->handler->connect_it) {
-      /* is there a protocol-specific connect() procedure? */
+    if(conn->tunnel_state[FIRSTSOCKET] == TUNNEL_COMPLETE) {
+      if(conn->handler->connect_it) {
+        /* is there a protocol-specific connect() procedure? */
 
-      /* Call the protocol-specific connect function */
-      result = conn->handler->connect_it(conn, protocol_done);
-    }
-    else
-      *protocol_done = TRUE;
+        /* Call the protocol-specific connect function */
+        result = conn->handler->connect_it(conn, protocol_done);
+      }
+      else
+        *protocol_done = TRUE;
 
-    /* it has started, possibly even completed but that knowledge isn't stored
-       in this bit! */
-    if(!result)
-      conn->bits.protoconnstart = TRUE;
+      /* it has started, possibly even completed but that knowledge
+         isn't stored in this bit! */
+      if(!result)
+        conn->bits.protoconnstart = TRUE;
+    }
   }
 
   return result; /* pass back status */
