【问题标题】:Problem connection to FTP server using FluentFTP from Ubuntu从 Ubuntu 使用 FluentFTP 连接到 FTP 服务器时出现问题
【发布时间】:2020-06-24 17:10:26
【问题描述】:

我正在使用此代码尝试建立与 Windows FTP 服务的 FTP 连接

FtpClient client = new FtpClient(ip, user, password);
client.ConnectTimeout = 600000;
client.ReadTimeout = 60000;
client.EncryptionMode = FtpEncryptionMode.Implicit;
client.SslProtocols = System.Security.Authentication.SslProtocols.Tls;
client.DataConnectionType = FluentFTP.FtpDataConnectionType.PASV;
client.ValidateAnyCertificate = true;

client.Connect();

在 Windows 机器上,连接已正确建立,但在我的 Ubuntu 机器上无法建立连接,我总是收到错误提示

"error:141E70BF:SSL routines:tls_construct_client_hello:no protocols available"

我怎样才能完成这项工作?

=============更新

我尝试了 FTPClient 的 AutoDetect 方法,但该方法没有检索到任何配置文件

AutoConnect 方法似乎也可以连接,但是当我尝试获取文件夹列表时,会出现配置文件需要 SSL 的错误

当我为客户端启用跟踪时,我会在日志中得到以下输出:

# Connect()
Status:   Connecting to server:21
Response: 220-Microsoft FTP Service
Response: 220 ************************************************************
Status:   Detected FTP server: WindowsServerIIS
Command:  AUTH TLS
Response: 234 AUTH command ok. Expecting TLS Negotiation.
Status:   Disposing FtpSocketStream...
Error:    FTPS Authentication Failed
                                    

【问题讨论】:

    标签: ubuntu .net-core fluentftp


    【解决方案1】:

    我刚刚想出了如何按照这篇文章的说明进行这项工作:

    OpenSSL v1.1.1 Ubuntu 20 TLSv1 - no protocols available

    还有这个

    https://askubuntu.com/questions/1233186/ubuntu-20-04-how-to-set-lower-ssl-security-level

    在我的情况下,我的目标服务器似乎很旧,nmap 输出是这样的:

    21/tcp open  ftp
    | ssl-enum-ciphers: 
    |   SSLv3: 
    |     ciphers: 
    |       TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C
    |       TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
    |       TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
    |     compressors: 
    |       NULL
    |     cipher preference: server
    |   TLSv1.0: 
    |     ciphers: 
    |       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (secp256r1) - A
    |       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (secp256r1) - A
    |       TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
    |       TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
    |       TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C
    |       TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
    |       TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
    |     compressors: 
    |       NULL
    |     cipher preference: server
    |     warnings: 
    |       64-bit block cipher 3DES vulnerable to SWEET32 attack
    |       Broken cipher RC4 is deprecated by RFC 7465
    |       Ciphersuite uses MD5 for message integrity
    |       Weak certificate signature: SHA1
    |_  least strength: C 
    

    我必须配置 openssl 以使用现在已被弃用的 TLSv1

    【讨论】:

      猜你喜欢
      • 2011-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多