【问题标题】:"The handshake failed due to an unexpected packet format" FluentFTP error when connecting to SFTP server“由于意外的数据包格式,握手失败”连接到 SFTP 服务器时出现 FluentFTP 错误
【发布时间】:2019-09-30 11:46:52
【问题描述】:

我正在尝试连接到 SFTP 服务器以下载一些文件。代码是用 C# 编写的,我使用 FluentFTP 连接到 FTP。客户端已将端口指定为 22。但是当我尝试以下代码时,出现错误

由于意外的数据包格式,握手失败

任何从事 FluentFTP 工作的人都可以建议我在我的代码中缺少什么。

FtpClient fclient = new FtpClient("xxx.yyy.com", "username", "password"); 
fclient.EncryptionMode = FtpEncryptionMode.Implicit;
fclient.SslProtocols = SslProtocols.Tls12;
fclient.Port = 22;                 
fclient.Connect();

谢谢。

【问题讨论】:

    标签: c# .net sftp fluentftp


    【解决方案1】:

    FluentFTP 是 FTP(S) 客户端。

    SFTP 是一个完全不同的协议。另见Is "SFTP" and "FTP over SSL" a same thing?

    您不能使用 FluentFTP 连接到 SFTP 服务器。您必须使用另一个 SFTP 库,请参阅 SFTP Libraries for .NET

    【讨论】:

      猜你喜欢
      • 2017-12-25
      • 1970-01-01
      • 2011-07-07
      • 2021-10-27
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多