Skip to content

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

Closed
@HarbourFrieght2

Description

@HarbourFrieght2

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions