JDK-8078298 : Error authentication NTLM on jdk1.6.0_91
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 7u65
  • Priority: P3
  • Status: Closed
  • Resolution: Incomplete
  • OS: linux_redhat_6.0
  • CPU: x86
  • Submitted: 2015-03-02
  • Updated: 2015-04-21
  • Resolved: 2015-03-05
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_91"
Java(TM) SE Runtime Environment (build 1.6.0_91-b13)
Java HotSpot(TM) Server VM (build 20.91-b07, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
2.6.32-358.14.1.el6.x86_64 #1 SMP Mon Jun 17 15:54:20 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
Error Autentication NTLM on jdk1.6.0_91

java.net.ProtocolException: Server redirected too many  times (20)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1470)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
        at com.test.SimpleNTLMAuthentication.main(SimpleNTLMAuthentication.java:12)


REGRESSION.  Last worked in version 6u43

ADDITIONAL REGRESSION INFORMATION: 
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
[root@ src]# /usr/java/jdk1.6.0_91/bin/javac com/test/SimpleNTLMAuthentication.java 
[root@ src]# /usr/java/jdk1.6.0_91/bin/java com/test/SimpleNTLMAuthentication
Starting SimpleNTLMAuthentication.class at Fri Feb 27 08:59:18 CST 2015
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
java.net.ProtocolException: Server redirected too many  times (20)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1470)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
        at com.test.SimpleNTLMAuthentication.main(SimpleNTLMAuthentication.java:12)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
[root@ src]# /usr/java/jdk1.6.0_39/bin/javac com/test/SimpleNTLMAuthentication.java 
[root@ src]# /usr/java/jdk1.6.0_39/bin/java com/test/SimpleNTLMAuthentication 
Starting SimpleNTLMAuthentication.class at Fri Feb 27 08:57:03 CST 2015
>Feeding username and password for ntlm
Total read bytes: 10133.
ACTUAL -
[root@ src]# /usr/java/jdk1.6.0_91/bin/javac com/test/SimpleNTLMAuthentication.java 
[root@ src]# /usr/java/jdk1.6.0_91/bin/java com/test/SimpleNTLMAuthentication
Starting SimpleNTLMAuthentication.class at Fri Feb 27 08:59:18 CST 2015
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
>Feeding username and password for ntlm
java.net.ProtocolException: Server redirected too many  times (20)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1470)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
        at com.test.SimpleNTLMAuthentication.main(SimpleNTLMAuthentication.java:12)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
package com.test;
import java.net.*;
import java.io.*;

public class SimpleNTLMAuthentication {

        public static void main(String[] args) {
                try {
                        System.out.println("Starting SimpleNTLMAuthentication.class at "+new java.util.Date());
                        Authenticator.setDefault(new MyAuthenticator());
                        URL urlDiestel = new URL("https://www.integracionesqapx.com.mx/wsUniversal/pxUniversal.asmx?WSDL");
                        InputStream ins = urlDiestel.openConnection().getInputStream();
                        BufferedReader reader = new BufferedReader(new InputStreamReader(ins));
                        String str;
                        int readBytes=0;
                        while((str = reader.readLine()) != null)
                                readBytes+=str.length();
                        System.out.println("Total read bytes: "+readBytes+".");
                } catch (Exception e) {
                        e.printStackTrace();
                        }
        }

        static class MyAuthenticator extends Authenticator{
                public PasswordAuthentication getPasswordAuthentication() {
                        System.out.println(">Feeding username and password for " + getRequestingScheme());
                        return (new PasswordAuthentication("usr_ws", "usr123".toCharArray()));
                }
        }
}

---------- END SOURCE ----------


Comments
Haven't received any response from the submitter within stipulated time. Closing this as resolved - Incomplete.
21-04-2015

There is no clear information regarding the reported JDK versions in the report. However, I checked this for JDK 6u43 and 8u40 and could notice following exceptions. JDK 6u43: ******************************************************************************************************************** >java SimpleNTLMAuthentication Starting SimpleNTLMAuthentication.class at Thu Mar 05 13:56:18 IST 2015 java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) ------------------------------- JDK 8u40: C:\Users\pardesha\Desktop\Java_Programs\9019465>java SimpleNTLMAuthentication Starting SimpleNTLMAuthentication.class at Thu Mar 05 16:02:16 IST 2015 java.net.ConnectException: Connection timed out: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketI mpl.java:79) ------------------------------- I have written back to the submitter enqiring more information. ******************************************************************************************************************** On 3/5/2015 4:09 PM, .................. wrote: > Hi, > > The report submitted by you does not have clear information pertaining to reported JDK version. > Can you please elaborate more about this issue including it's reproducibility with latest JDK versions 7u76 and 8u40. > > Thank You, > ......... ************************************************************************************************************************
05-03-2015