Skip to content
Advertisement

Unable to tunnel through proxy. Proxy returns “HTTP/1.1 407” via https

I am faced with a curious behaviour of java6/8. I try to tunnel through a proxy which needs basic user authentication. Doing this by the standard java Authenticator. If I try to access a https url as the first url, an exception is thrown:

java.io.IOException: Unable to tunnel through proxy. Proxy returns “HTTP/1.1 407 Proxy Authentication Required”

But if I access a http URL first and then the https URL, the https access works fine.

Given that code:

JavaScript

Any suggestions, ideas?

Advertisement

Answer

You have to edit the variables jdk.http.auth.tunneling.disabledSchemes and jdk.http.auth.proxying.disabledSchemes to blank like this:

JavaScript

In my case I found in this file

jdk1.8.0_111/jre/lib/net.properties

Advertisement