SSH.Net error "The connection was closed by the server: Failed to read binary packet data! (ProtocolError)"

619 Views Asked by At

I use SSH.Net nuget package to connect to my partner SFTP Server and getting the error The connection was closed by the server: Failed to read binary packet data! (ProtocolError).

Here is my code:

            var methods = new List<AuthenticationMethod>();
            methods.Add(new PasswordAuthenticationMethod(userName, password));
            var con = new ConnectionInfo(hostName, port, userName, methods.ToArray());
            var sftpClient = new SftpClient(hostName, userName, password);           
            sftpClient.Connect();

Howerver, these above code can connect to my company SFTP. Additional, If I using FileZilla 3.62.2, I can connect to partner SFTP.

I don't know what is the difference between my company SFTP and partner SFTP and how to solve the problem. Please help me.

SSH.Net Version: 2020.0.2; .Net Framework 4.5.2

0

There are 0 best solutions below