I've actually solved the problem already by registering an Authenticator, which provides the credentials.

Thanks anyway :)

Oleg Kalnichevski wrote:
On Sun, 2008-08-10 at 21:21 +0200, Svyatoslav Hresyk wrote:
Hello,

I have run into problems, trying to use a SOCKS proxy with authentication.

I keep getting "java.net.SocketException: SOCKS : authentication failed" regardless of wether I set the username and password or not. I have tested the SOCKS server with Proxifier and it works correctly, so it's not a server issue.

Here is a code snippet, I am getting the Exception on:

        HttpClient client = new HttpClient();
        client.getHostConfiguration().setHost("www.google.com", 80);

        System.setProperty("socksProxyHost", "1.1.1.1");
        System.setProperty("socksProxyPort", "1234");
Credentials cred = new UsernamePasswordCredentials("username", "password");
        client.getState().setProxyCredentials(AuthScope.ANY, cred);
GetMethod get = new GetMethod("/"); client.executeMethod(get);

I have also tried setting java.net.socks.username and java.net.socks.password
system properties, without luck.

Any help would be greatly appreciated.

Thanks in advance!


As far as I know SOCKS proxying works on the TCP/IP socket level, and
not on the HTTP level. I am not sure anyone on this list would be able
to be of help.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to