简体   繁体   中英

FtpWebRequest over SSL/TLS on a FileZilla Server with “Require TLS session resumption on data connection when using PROT P” enabled

My application targets .NET 4.6.1 and I try to use FtpWebRequest to connect to a FileZilla server using TLS. However, when the option TLS session resumption is enable, the code below failed with

450 TLS session of data connection has not resumed or the session does not match the control connection

If I disable the option, the code works. What is surprising is that the code worked until we need to reboot the server for update it. We tried with SSL code using PHP and it works as well when the option is enable.

System.Net.ServicePointManager.ServerCertificateValidationCallback =
    New System.Net.Security.RemoteCertificateValidationCallback(
        AddressOf myCertificateValidation)

' Set up the request
Dim ftpRequest As System.Net.FtpWebRequest =
    CType(System.Net.WebRequest.Create("ftp://myserver.mydomain.eu"),
        System.Net.FtpWebRequest)
ftpRequest.EnableSsl = True
ftpRequest.KeepAlive = False
ftpRequest.UsePassive = False

' use the provided credentials
ftpRequest.Credentials = New System.Net.NetworkCredential("MyUser", "MyPwd")

' List the directory content
ftpRequest.Method = System.Net.WebRequestMethods.Ftp.ListDirectoryDetails

' Send the request
Dim ftpResponse As System.Net.FtpWebResponse =
    CType(ftpRequest.GetResponse, System.Net.FtpWebResponse)

I tried to set several parameters but it's always the same result.

I finally found the issue. You have to change the ftpRequest.KeepAlive to true in the code below and it does the job.

I checked so many parameter's configuration before finding the good one...

Hope this help.

Etienne.

From https://www.limilabs.com/blog/ftp-tls-encrypted-data-connections-fail-ems

It seems a Windows update in October 2019 causes FileZilla Server to exhibit this bug, due to its use of an outdated version of OpenSSL (1.0.2.11).

As yet there is no ETA on a fix for FileZilla Server. A temporary, but not recommended, solution is to uninstall the Windows update.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM