I got the exception below when the client tries to connect to FTP server:
Socket read operation has timed out after 30000 milliseconds.
Source = "Renci.SshNet"
at Renci.SshNet.Abstractions.SocketAbstraction.Read(Socket socket, Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout) at Renci.SshNet.Session.SocketReadLine(TimeSpan timeout) at Renci.SshNet.Session.Connect() at Renci.SshNet.BaseClient.Connect() at SftpClient.ReadAllBytesAsync() in C:\SftpClient\SftpClient.cs:line 42
Code below:
using (Renci.SshNet.SftpClient sftp = new Renci.SshNet.SftpClient(server,
21,
Username,
Password))
sftp.Connect(); //exception here
content = sftp.ReadAllBytes(FilePath);
sftp.Disconnect();
}
SSH.NET version: 2016.1.0
However, it connects via telnet like below via command prompt:
telnet server_ip_address 21
220 (SFTPPlus_3.15.0) Welcome to the FTP/FTPS Service.
A staff on server side sends me public certificates, which I installed on my Windows 10.
Any idea?
Solution:
Use this one: github.com/robinrodricks/FluentFTP