/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6520665 6357133
* @summary 6520665 & 6357133: NTLM authentication issues.
*/
public class NTLMTest
{
try {
// Test with direct connection.
startServer(serverSS, false);
// Test with proxy.
} catch (IOException e) {
e.printStackTrace();
}
}
try {
uc.getInputStream();
} catch (ProtocolException e) {
/* java.net.ProtocolException: Server redirected too many times (20) */
throw new RuntimeException("Failed: ProtocolException", e);
} catch (IOException ioe) {
/* IOException is OK. We are expecting "java.io.IOException: Server
* returned HTTP response code: 401 for URL: ..."
*/
//ioe.printStackTrace();
} catch (NullPointerException npe) {
}
}
"HTTP/1.1 401 Unauthorized\r\n" +
"Content-Length: 0\r\n" +
"WWW-Authenticate: NTLM\r\n\r\n",
"HTTP/1.1 401 Unauthorized\r\n" +
"Content-Length: 0\r\n" +
"WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAACgAAAABggAAU3J2Tm9uY2UAAAAAAAAAAA==\r\n\r\n"};
"HTTP/1.1 407 Proxy Authentication Required\r\n" +
"Content-Length: 0\r\n" +
"Proxy-Authenticate: NTLM\r\n\r\n",
"HTTP/1.1 407 Proxy Authentication Required\r\n" +
"Content-Length: 0\r\n" +
"Proxy-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAACgAAAABggAAU3J2Tm9uY2UAAAAAAAAAAA==\r\n\r\n"};
public void run() {
boolean doing2ndStageNTLM = false;
while (true) {
try {
if (!doing2ndStageNTLM) {
doing2ndStageNTLM = true;
} else {
doing2ndStageNTLM = false;
}
//System.out.println("connectionCount = " + connectionCount);
} catch (IOException ioe) {
}
}
} });
}
try {
//System.out.println("Input :" + header);
//System.out.println("Output:" + resp[i]);
}
s.close();
} catch (IOException ioe) {
}
}
{
count++;
return null;
}
public int getCallCount() {
return count;
}
}
}