Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An established connection was aborted by the server. (SOCKS5 Proxy) #633

Closed
HarbourFrieght2 opened this issue Feb 28, 2020 · 1 comment
Closed

Comments

@HarbourFrieght2
Copy link

HarbourFrieght2 commented Feb 28, 2020

var connectionInfo = new ConnectionInfo("a.host.name", 22, username, ProxyTypes.Socks5, "127.0.0.1", 9050, "", "", new PasswordAuthenticationMethod(username, password) );

Results in the following exception. I can use the specified proxy in putty, firefox, other applications etc just fine, however it is not working with SSH.NET

Unhandled Exception: Renci.SshNet.Common.SshConnectionException: An established connection was aborted by the server.
at Renci.SshNet.Abstractions.SocketAbstraction.Send(Socket socket, Byte[] data, Int32 offset, Int32 size)
at Renci.SshNet.Session.ConnectSocks5()
at Renci.SshNet.Session.Connect()
at Renci.SshNet.BaseClient.Connect()
at WS.Program.Main(String[] args)

If I try to use localhost instead of 127.0.0.1, the following different exception is thrown

Unhandled Exception: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Renci.SshNet.Abstractions.SocketAbstraction.Connect(IPEndPoint remoteEndpoint, TimeSpan connectTimeout)
at Renci.SshNet.Session.SocketConnect(String host, Int32 port)
at Renci.SshNet.Session.Connect()
at Renci.SshNet.BaseClient.Connect()
at WS.Program.Main(String[] args)

@drieseng
Copy link
Member

This is probably a duplicate of issue #125.
Please try 2020.0.0-beta1, and reopen this issue if that didn't resolve the problem for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants