8225298: Improve TLS connection support

Reviewed-by: dfuchs, igerasim, michaelm, rhalade, skoivu
This commit is contained in:
Chris Hegarty 2019-06-21 10:51:10 +01:00
parent 908b4e8df3
commit 8e2b10070e

View file

@ -2171,6 +2171,10 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
} while (retryTunnel < maxRedirects);
if (retryTunnel >= maxRedirects || (respCode != HTTP_OK)) {
if (respCode != HTTP_PROXY_AUTH) {
// remove all but authenticate responses
responses.reset();
}
throw new IOException("Unable to tunnel through proxy."+
" Proxy returns \"" +
statusLine + "\"");