gpt4 book ai didi

ftp - 如何修复 : The handshake failed due to an unexpected packet format?

转载 作者:行者123 更新时间:2023-12-04 21:38:23 27 4
gpt4 key购买 nike

我正在从 Windows Server 2008 R2 连接到运行 vsFTPd 2.0.7 的 Linux FTP 服务器。我通过 SSL 连接。

这是它失败的代码行:

sslStream = new SslStream(stream, false, CertificateValidation);

这是日志:
220 (vsFTPd 2.0.7)
AUTH SSL
234 Proceed with negotiation.

我收到以下错误:
System.IO.IOException: The handshake failed due to an unexpected packet format.
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at KellermanSoftware.NetFtpLibrary.ProxySocket.InitSsl()
at KellermanSoftware.NetFtpLibrary.FTP.Connect(Boolean implicitConnection)

最佳答案

从我的谷歌搜索来看,这似乎是 vsftpd 的常见问题。
http://www.question-defense.com/2010/02/04/vsftpd-error-gnutls-error-9-a-tls-packet-with-unexpected-length-was-received

您可以查看该文章以获取解决方案的提示

它归结为:

  • 为 ftpes 配置 vsftpd(带有显式 TLS/SSL 的文件传输协议(protocol))
  • 验证您是否已生成 SSL 证书,或在必要时生成一个
  • 修改 vsftpd.conf 以允许 FTPES 连接/传输
  • 重新启动 vsftpd 以使更改生效
  • 验证您正在运行最新版本并在必要时升级

  • 更新
    其他要检查的是: http://ftps.codeplex.com/Thread/View.aspx?ThreadId=63605
    该线程通过以下代码块示例讨论隐式和显式模式之间的区别:
    private Stream GetDataStream()
    {
    Stream s = null;

    if (SslSupportCurrentMode == ESSLSupportMode.Implicit)
    {
    s = dataClient.GetStream();
    }
    else if ((sslSupportCurrentMode & ESSLSupportMode.DataChannelRequested) == ESSLSupportMode.DataChannelRequested)
    {
    if (dataSslStream == null)
    dataSslStream = CreateSSlStream(dataClient.GetStream(), false);
    s = dataSslStream;
    }
    else
    {
    s = dataClient.GetStream();
    }

    return s;
    }

    关于ftp - 如何修复 : The handshake failed due to an unexpected packet format?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2456786/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com