Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8078298

Error authentication NTLM on jdk1.6.0_91

XMLWordPrintable

    • x86
    • linux_redhat_6.0

      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 ----------

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: