Skip to content

FTPS data connection resumption with FileZilla #22225

Description

@lsabouri74

I did this

FTPS fIle upload to FileZilla with libcurl fails since updating to 8.21.0. It was working with 8.20.0. I am using SChannel and I had issues before where I had to cap TLS version to 1.2, since SChannel doesn't seem to handle session resumption well in TLS 1.3.

Here is my code snipet:

m_CurlHandle = curl_easy_init(), &curl_easy_cleanup )
...
CURL_SETOPT(CURLOPT_READDATA, src_file );
CURL_SETOPT(CURLOPT_UPLOAD, 1L );
CURL_SETOPT(CURLOPT_INFILESIZE_LARGE, (curl_off_t)file_size );
const std::string url("ftp://ftp_server/~/321AD0C9-EDE2-40E1-8DF7-7778C7495D90_0-IF_1_test.pdf" );
CURL_SETOPT(CURLOPT_URL, url.c_str() );
CURL_SETOPT(CURLOPT_SSL_VERIFYPEER, 0L);
CURL_SETOPT(CURLOPT_SSL_VERIFYHOST, 0L);
CURL_SETOPT(CURLOPT_USE_SSL, CURLUSESSL_ALL );
CURL_SETOPT(CURLOPT_FTPSSLAUTH, CURLFTPAUTH_DEFAULT );
CURL_SETOPT(CURLOPT_USERNAME, UserName.c_str());
CURL_SETOPT(CURLOPT_PASSWORD, UserPassword.c_str());
CURL_SETOPT(CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_TLSv1_2);
CURL_SETOPT(CURLOPT_FTP_CREATE_MISSING_DIRS, 1L );
CURL_SETOPT(CURLOPT_LOW_SPEED_TIME, low_speed_timeout);
CURL_SETOPT(CURLOPT_LOW_SPEED_LIMIT, low_speed_limit);
CURL_SETOPT( CURLOPT_CONNECTTIMEOUT, config.Get(L"FileTransmissionConnectionTimeOut", 10));   // 10 seconds to connect to remote server
CURLcode curl_res = curl_easy_perform( m_CurlHandle.get() );

here is the curl debug output:

handle(0x00000198B6CF7FB0) CURLINFO_TEXT->Host ftp_server:21 was resolved.
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->IPv6: (none)
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->IPv4: 10.9.79.97
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->  Trying 10.9.79.97:21...
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->Established connection to ftp_server (10.9.79.97 port 21) from 10.9.79.28 port 53119 
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->220-FileZilla Server 1.12.6
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->220 Please visit https://filezilla-project.org/
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_OUT->AUTH SSL
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->234 Using authentication type TLS.
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->schannel: disabled automatic use of client certificate
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->Established connection to ftp_server (10.9.79.97 port 21) from 10.9.79.28 port 53119 
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_OUT->USER *****
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->331 Please, specify the password.
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_OUT->PASS *****
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->230 Login successful.
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_OUT->PBSZ 0
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->200 PBSZ=0
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_OUT->PROT P
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->200 Protection level set to P
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_OUT->PWD
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->257 "/" is current directory.
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->Entry path is '/'
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_OUT->CWD ~
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->250 CWD command successful
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_OUT->EPSV
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->Connect data stream passively
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->229 Entering Extended Passive Mode (|||49274|)
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->Connecting to 10.9.79.97 port 49274
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->  Trying 10.9.79.97:49274...
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->schannel: disabled automatic use of client certificate
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_OUT->TYPE I
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->200 Type set to I
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_OUT->STOR EB0C5352-5ACF-4614-A692-74E217559676_0-IF_1_test.pdf
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->150 Starting data transfer.
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->Established 2nd connection to ftp_server (10.9.79.97 port 49274) from 10.9.79.28 port 53120 
handle(0x00000198B6CF7FB0) CURLINFO_DATA_OUT->
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->schannel: shutting down SSL/TLS connection with ftp_server port 21
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->Shutdown send direction error: 81. Broken server? Proceeding as if everything is ok.
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->upload completely sent off: 102 bytes
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->Remembering we are in directory "~/"
handle(0x00000198B6CF7FB0) CURLINFO_HEADER_IN->425 Unable to build data connection: TLS session of data connection not resumed.
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->server did not report OK, got 425
handle(0x00000198B6CF7FB0) CURLINFO_TEXT->Connection #0 to host ftp_server:21 left intact

Please let me know if it is a bug, or if there is something I am doing wrong.

I expected the following

I would expect the upload to work as it was working with 8.20.0.

curl/libcurl version

curl-8.21.0 with SChannel

operating system

Windows 11

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions