I try to connect to an FTP server via SFTP using SecureFTPConnection from my development PC.
The connect attempt times out after 10 s, and a System.IO.IOException is thrown. No FTPException as I would expect.
It may seem this error does not occur on another PC.
I have turn on LogToTrace, and my output window in VS2015 contains these messages:
INFO [LicenseProperties] 28 nov 2016 15:04:05.995 : Production license
DEBUG [SSLFTPClient] 28 nov 2016 15:04:05.996 : Connecting to 157.237.87.57:21
DEBUG [SSLFTPControlSocket] 28 nov 2016 15:04:05.996 : waitOnShutdownSSL=True
DEBUG [ExFTPControlSocket] 28 nov 2016 15:04:05.997 : Created control-socket: SocksContext=, ProxySettings=NoProxy, RemoteHost=157.237.87.57, controlPort=21, timeout=10000
DEBUG [FTPControlSocket] 28 nov 2016 15:04:05.997 : StrictReturnCodes=True
DEBUG [HostNameResolver] 28 nov 2016 15:04:05.997 : Resolving DEBUG [HostNameResolver] 28 nov 2016 15:04:06.010 : 157.237.87.57 resolved to 157.237.87.57
DEBUG [ExFTPControlSocket] 28 nov 2016 15:04:06.010 : Connecting directly to ftp-server 157.237.87.57:21
INFO [SSLFTPSocket] 28 nov 2016 15:04:06.010 : Connecting to 157.237.87.57:21 with timeout 10000 ms
157.237.87.57
DEBUG [HostNameResolver] 28 nov 2016 15:04:06.010 : 157.237.87.57 resolved to 157.237.87.57
DEBUG [ExFTPControlSocket] 28 nov 2016 15:04:06.010 : Connecting directly to ftp-server 157.237.87.57:21
INFO [SSLFTPSocket] 28 nov 2016 15:04:06.010 : Connecting to 157.237.87.57:21 with timeout 10000 ms
ERROR [SSLFTPSocket] 28 nov 2016 15:04:16.014 : Failed to connect to 157.237.87.57:21 within timeout 10000 ms
Exception thrown: 'System.IO.IOException' in edtFTPnetPRO.dll
Exception thrown: 'System.IO.IOException' in edtFTPnetPRO.dll
Exception thrown: 'System.IO.IOException' in edtFTPnetPRO.dll
ERROR [SSLFTPSocket] 28 nov 2016 15:04:16.014 : Failed to connect to 157.237.87.57:21 within timeout 10000 ms
So, here are two things:
Why does SecureFTPConnection try port 21? Should it not be 22? If I force use of port 22 by setting <connection>.ServerPort to 22, I get the same result, though.
Why does the connect fail while an sftp connect using WinSCP works just fine?
LogLevel is set to All.
Help to diagnose this is highly appreciated.
Morten