[HtmlUnit] [htmlunit:bugs] #1960 Authenticated SOCKS5 with username/password does not work

RBRi via HtmlUnit-develop <[email protected]> Sat, 21 Jul 2018 16:08:19 -0000
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID </p/htmlunit/bugs/1960/6816feffa856fb84f38a1f9477698f7f5b8506e1.bugs@htmlunit.p.sourceforge.net>
As a reminder for myself
https://stackoverflow.com/questions/1540424/java-proxy-client-class-that-supports-authentication


---

** [bugs:#1960] Authenticated SOCKS5 with username/password does not work**

**Status:** open
**Group:** 2.30
**Labels:** socks socks5 authentication 
**Created:** Tue Apr 03, 2018 07:27 AM UTC by Rahul Vaidya
**Last Updated:** Tue Apr 03, 2018 05:58 PM UTC
**Owner:** nobody


I am using this to set up my proxy connection:

client.getOptions().setProxyConfig(new ProxyConfig(host, port, true));
DefaultCredentialsProvider credentialsProvider = (DefaultCredentialsProvider) client.getCredentialsProvider();
        credentialsProvider.addCredentials(username, password);
        
When I try to connect I get this:

[main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://checkip.amazonaws.com:80: SOCKS : authentication failed
[main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://checkip.amazonaws.com:80
[main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://checkip.amazonaws.com:80: SOCKS : authentication failed
[main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://checkip.amazonaws.com:80
[main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {}->http://checkip.amazonaws.com:80: SOCKS : authentication failed
[main] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://checkip.amazonaws.com:80
Error getting web client IP address
java.net.SocketException: SOCKS : authentication failed
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:473)
	at java.net.Socket.connect(Socket.java:589)
	at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
	at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:192)
	at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1401)
	at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1319)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:315)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:463)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:448)


---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
HtmlUnit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop