8174985: NTLM authentication doesn't work with IIS if NTLM cache is disabled
authordfuchs
Thu, 23 Feb 2017 12:08:44 +0000
changeset 44759 b4a251d223e2
parent 44758 e9f82f61bc22
child 44760 61b03b960583
8174985: NTLM authentication doesn't work with IIS if NTLM cache is disabled Reviewed-by: aefimov, chegar, rhalade
jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java
--- a/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java	Wed Feb 22 15:23:09 2017 +0530
+++ b/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java	Thu Feb 23 12:08:44 2017 +0000
@@ -963,7 +963,11 @@
                 pi.setContentType(responses.findValue("content-type"));
             }
 
-            if (isKeepingAlive())   {
+            // If disableKeepAlive == true, the client will not be returned
+            // to the cache. But we still need to use a keepalive stream to
+            // allow the multi-message authentication exchange on the connection
+            boolean useKeepAliveStream = isKeepingAlive() || disableKeepAlive;
+            if (useKeepAliveStream)   {
                 // Wrap KeepAliveStream if keep alive is enabled.
                 logFinest("KeepAlive stream used: " + url);
                 serverInput = new KeepAliveStream(serverInput, pi, cl, this);