]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ftp: active mode with SSL, add the damn filter
authorStefan Eissing <stefan@eissing.org>
Fri, 3 Mar 2023 14:15:31 +0000 (15:15 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 7 Mar 2023 14:22:22 +0000 (15:22 +0100)
- since 7.87.0 we lost adding the SSL filter for an active
  FTP connection that uses SSL. This leads to hangers and timeouts
  as reported in #10666.

Reported-by: SandakovMM on github
Fixes #10666
Closes #10669

lib/ftp.c

index 3777e038789896a995dd97dbcf7054ad949f1cfc..163262f1afbe3d7b830ee5a32702e347ee9bb7cd 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -436,6 +436,12 @@ static CURLcode InitiateTransfer(struct Curl_easy *data)
   bool connected;
 
   DEBUGF(infof(data, "ftp InitiateTransfer()"));
+  if(conn->bits.ftp_use_data_ssl && data->set.ftp_use_port &&
+     !Curl_conn_is_ssl(conn, SECONDARYSOCKET)) {
+    result = Curl_ssl_cfilter_add(data, conn, SECONDARYSOCKET);
+    if(result)
+      return result;
+  }
   result = Curl_conn_connect(data, SECONDARYSOCKET, TRUE, &connected);
   if(result || !connected)
     return result;