8225298: Improve TLS connection support
Reviewed-by: dfuchs, igerasim, michaelm, rhalade, skoivu
--- 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 + "\"");