我正在从Windows Server2008FTP连接到运行vsFTPd 2.0.7的Linux R2服务器。我正在通过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)发布于 2010-03-17 01:54:49
从我的google搜索来看,这似乎是vsftpd的一个常见问题。
http://www.question-defense.com/2010/02/04/vsftpd-error-gnutls-error-9-a-tls-packet-with-unexpected-length-was-received
你可以从那篇文章中找到解决方案的提示。
它可以归结为:
为TLS/SSL)
更新
要检查的其他内容是: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;
}https://stackoverflow.com/questions/2456786
复制相似问题