+1 vote
by (170 points)

Applies to: Rebex SFTP

2 Answers

0 votes
by (58.9k points)

Sftp sftp = new Sftp();
sftp.Connect("server", port); // "test.rebex.net"

Ftp ftp = new Ftp();
ftp.Connect("server", port, SslMode.Implicit); // "test.rebex.net"

by (170 points)
Hi - it turns out that the server in question only has SFTP capability (not vanilla FTP nor FTPS over port 990) and the error only happens sporadically.  Can this error be raised under any circumstances when using only the SFTP Rebex library and a pure SFTP site?
by (58.9k points)
Yes, it can be raised not only when connecting to a non-SSH server but it also when connecting to a real SSH/SFTP server, although then it would indicate some serious trouble between the client and server. Have you already had a chance to create a verbose log as requested in my below answer?
0 votes
by (58.9k points)

by (170 points)
Hi - this was resolved, it turned out that the IP of the server our app was running on (we were downloading files using Rebex from a remote SFTP site) was blacklisted by that site and this error resulted.  I think the error message is misleading in this case since I think the connection is severed/not permitted.  Thanks.
by (58.9k points)
edited by
Thank you for letting us know  that the solution is resolved! And thanks for your suggestion, however, the two cases are unfortunatelly unrecognizable from our point of view - your SFTP server with your blacklisted IP behaves exactly as an FTP server in implicit mode and at the same time the blacklisting seems to be far less likely.
by (150k points)
The misleading error message was actually caused by the fact that the blacklisted client was actually *able to establish a TCP connection* to the server, but when established, the connection was closed. To the client, this really looks like it's not connecting to an SSH/SFTP server at all... Perhaps adding "and check your firewall settings" to the error message would make it more clear?
...