How do I fix: The handshake failed due to an unexpected packet format?

Posted by Greg Finzer on Stack Overflow See other posts from Stack Overflow or by Greg Finzer
Published on 2010-03-16T17:50:02Z Indexed on 2010/03/16 17:51 UTC
Read the original article Hit count: 1510

Filed under:

I am connecting from Windows Server 2008 R2 to a Linux FTP Server running vsFTPd 2.0.7. I am connecting via SSL.

Here is the line of code it is failing on:

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

Here is the log: 220 (vsFTPd 2.0.7) AUTH SSL 234 Proceed with negotiation.

I receive the following error:

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)

© Stack Overflow or respective owner

Related posts about ftp