I have a test application that is testing FTP with TLS12. The server OS is Redhat, the server is vsftpd version 3.0.1 which supports TLS12 and SSLv3.
The code is developed in C# on VS2017, .Net 4.7.2.
When I start debugging there is a long pause and nothing shows up in the debug window but this error shows up in the source window associated with the GetList request. Please note the port number on the IP address: I am connected to port 21, what is that port?
System.Net.Sockets.SocketException: 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond :30766'
The server is up and "pingable".
The server supports port 21 and not 990.
I need to get this and other FTP functions (download file, delete file) to work before I can purchase your product.
I am willing to test any changes to my code or yours.
My code is:
Limilabs.FTP.Log.Enabled = true;
using(Ftp ftp = new Ftp()) {
ftp.ServerCertificateValidate +=
(sender, e) => { e.IsValid = true; };
ftp.SSLConfiguration.EnabledSslProtocols = SslProtocols.Tls12;
ftp.Connect("ftp host", 21);
ftp.AuthTLS();
ftp.Login("user", "pass");
List<FtpItem> items = ftp.GetList();
foreach(FtpItem item in items) {
Console.WriteLine("Name: {0}", item.Name);
Console.WriteLine("Size: {0}", item.Size);
Console.WriteLine("Modify date: {0}", item.ModifyDate);
Console.WriteLine("Is folder: {0}", item.IsFolder);
Console.WriteLine("Is file: {0}", item.IsFile);
Console.WriteLine("Is symlink: {0}", item.IsSymlink);
Console.WriteLine();
}
ftp.Close();
}
The log is:
00:33:17 2.0.19002.942
00:33:17 Checking if license file is present.
00:33:17 Connecting to 'ftp-diabesity.dfnetresearch.com:21', SSL: False.
00:33:17 Control connection uses port: 55727 (217,175)
00:33:17 S: 220 (vsFTPd 3.0.2)
00:33:17 C: AUTH TLS
00:33:17 S: 234 Proceed with negotiation.
00:33:17 C: USER jobrien
00:33:17 S: 331 Please specify the password.
00:33:17 C: PASS XXXXXXX
00:33:17 S: 230 Login successful.
00:33:17 C: FEAT
00:33:17 S: 211-Features:
00:33:17 S: AUTH TLS
00:33:17 S: EPRT
00:33:17 S: EPSV
00:33:17 S: MDTM
00:33:17 S: PASV
00:33:17 S: PBSZ
00:33:17 S: PROT
00:33:17 S: REST STREAM
00:33:17 S: SIZE
00:33:17 S: TVFS
00:33:17 S: UTF8
00:33:17 S: 211 End
00:33:17 C: OPTS UTF8 ON
00:33:17 S: 200 Always in UTF8 mode.
00:33:17 C: TYPE A
00:33:17 S: 200 Switching to ASCII mode.
00:33:17 C: PBSZ 0
00:33:17 S: 200 PBSZ set to 0.
00:33:17 C: PROT P
00:33:17 S: 200 PROT now Private.
00:33:17 C: PASV
00:33:17 S: 227 Entering Passive Mode (192,168,6,90,120,177).
Exception thrown: 'System.Net.Sockets.SocketException' in System.dll
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in System.dll "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
Windows Defender Firewall is off as is Windows Defender Virus protection.