changeset 52239:0d78bb7c14b3

8225298: Improve TLS connection support Reviewed-by: dfuchs, igerasim, michaelm, rhalade, skoivu
author igerasim
date Sat, 22 Jun 2019 20:46:46 -0700
parents 3e4bd2b7b589
children e49640590658
files src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Sun Jun 16 13:14:32 2019 -0700
+++ b/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Sat Jun 22 20:46:46 2019 -0700
@@ -2165,6 +2165,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 + "\"");