Skip to content

Problem with SOCKS5 proxy #417

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

Closed
tfontS2G opened this issue Apr 6, 2018 · 2 comments
Closed

Problem with SOCKS5 proxy #417

tfontS2G opened this issue Apr 6, 2018 · 2 comments

Comments

@tfontS2G
Copy link

tfontS2G commented Apr 6, 2018

Hello,

I'm trying to connect to an SFTP server through SOCKS5 proxy. When I try to connect I get: "SOCKS5: General Failure" exception. I'm importing directly the "Renci.SshNet.dll" as a reference into my project.

Any ideas about what is the problem?

@tfontS2G
Copy link
Author

tfontS2G commented Apr 6, 2018

The code:

`namespace SFTP
{
class Program
{
static void Main(string[] args)
{
string username = "";
string password = "
";
string host = "****";
int port = 22222;

        string proxy_Host = @"****";
        string proxy_Username = @"****";
        string proxy_Password = "****";
        int proxy_Port = 1080;

        AuthenticationMethod authMethod = new PasswordAuthenticationMethod(username, password);

        ConnectionInfo sftpConnection = new ConnectionInfo(host, port, username, ProxyTypes.Socks5, proxy_Host, proxy_Port, proxy_Username, proxy_Password, authMethod);

        SftpClient client = new SftpClient(sftpConnection);

        try
        {
            client.Connect();
            

            Console.WriteLine("Connection established!");
            Console.ReadKey();
        }
        catch (Exception e)
        {
            Console.WriteLine("Exception: " + e.ToString());
            Console.ReadKey();
        }
    }
}

}`

@drieseng
Copy link
Member

This is probably a duplicate of #125, which was fixed in 2020.0.0-beta1.

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