1

I have a program that opens a file from our internal SVN by using

url.openStream();

on that url. This works fine with Java 7 and also with jdk1.8.0_161.

But, when I tried with the OpenJDK version jdk8u202-b08, I get

java.io.IOException: Server returned HTTP response code: 401 for URL: ...

Has the behaviour of openStream changed in later build versions of Java 8? If so, how can I solve this problem?

EDIT:

Additional tests showed that OpenJDK in version 8u192 works as well. So it must be a change between build version 192 and 202.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142

1 Answers1

3

My colleague finally found out that there is a change in the default behaviour of the authentication. You can reverse this by using

java -Djdk.http.ntlm.transparentAuth=enabled -Djdk.http.ntlm.transparentAuth=trustedHosts

See also:

How to provide ntlm authentication while calling any url?

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142