# HG changeset patch # User chegar # Date 1561110670 -3600 # Node ID 6b93cc7741ba3defc9199dd75f4a6bca6ffdc912 # Parent 2ede50a0f67d60943364fb6e4d0f9c5f7ee4e9a8 8225298: Improve TLS connection support Reviewed-by: dfuchs, igerasim, michaelm, rhalade, skoivu diff -r 2ede50a0f67d -r 6b93cc7741ba src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java --- a/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Wed Jun 19 15:24:42 2019 -0700 +++ b/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Fri Jun 21 10:51:10 2019 +0100 @@ -2171,6 +2171,10 @@ } 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 + "\"");