.net - 启用 "Require TLS session resumption on data connection when using PROT P"的 FileZilla 服务器上基于 SSL/TLS 的 FtpWebRequest

标签 .net vb.net ssl ftp ftpwebrequest

我的应用程序以 .NET 4.6.1 为目标,我尝试使用 FtpWebRequest使用 TLS 连接到 FileZilla 服务器。
但是,当启用选项 TLS session 恢复时,下面的代码失败了

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


如果我禁用该选项,则代码有效。
令人惊讶的是,在我们需要重新启动服务器进行更新之前,代码一直有效!
我们尝试使用 PHP 使用 SSL 代码,并且在启用该选项时它也可以正常工作。
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)
我尝试设置几个参数,但结果始终相同。

最佳答案

我终于找到了问题。您必须在下面的代码中将 ftpRequest.KeepAlive 更改为 true,它才能完成这项工作。

在找到好的参数之前,我检查了很多参数的配置...

希望这有帮助。

艾蒂安。

关于.net - 启用 "Require TLS session resumption on data connection when using PROT P"的 FileZilla 服务器上基于 SSL/TLS 的 FtpWebRequest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58506578/

相关文章:

vb.net 在文本框中按下箭头键

c# - 如何在 .NET C# 中为 HTTP/2 服务器实现 TLS-ALPN

.net - 与 LINQ 一起使用的集合类的要求

c# - 事务性 NTFS (TxF) 有任何真实的企业级体验吗?

java - 构造函数调用自身

eclipse - 安装自签名 p12 证书后在 firefox 上获取 ssl_error_bad_cert_alert

c++ - QPID C++ 代理和 QPID-CPP SSL 证书

c# - Mono 可以在 rdlc 中创建/运行报告吗?

c# - 为什么在实现 IEnumerator<T> 的类中需要 IEnumerator.Current?

vb.net - 创建动态 DataGridViewComboBoxCell