0

I have a case where the server I am working on must be able to use NTLM authentication. I believe it is setting:

jdk.http.ntlm.transparentAuth=allHosts

But I want to prove that at run time. That value is set in a special place. From inside where Java is installed in my case the file is here:

C:\Program Files\AdoptOpenJDK\jdk-11.0.4.11-hotspot\conf\net.properties

How can I query that value? I would like to be able to do it from a debugger in an Evaluate, while paused at a break point. Something like the following would be good (but note that this doesn't work, since it isn't part of the env)

System.getenv("Path")
Solx
  • 4,611
  • 5
  • 26
  • 29
  • System.getProperty("jdk.http.....") – kofemann Sep 07 '21 at 20:01
  • I am assuming this "jdk" property is stored in an alternate store. It doesn't show up using System.getProperties() nor when using System.getProperty. Note that I have a server where it is working, and used that to verify it cannot be seen those ways. – Solx Sep 08 '21 at 12:52

2 Answers2

2

From this I would say the solution is as follows:

System.getProperty("jdk.http.ntlm.transparentAuth");
Cardinal System
  • 2,749
  • 3
  • 21
  • 42
  • Nice try, seemed like a good one - but sadly didn't work. I guess it is stored elsewhere. – Solx Sep 07 '21 at 20:43
  • Sorry, I should have mentioned on a working system, where that value is set, that call did not show its value. – Solx Sep 08 '21 at 12:37
  • The first lines of net.properties say (emphasis added) "These values are only used when the system properties are _not_ [set]" so it's impossible for them to be system properties. – dave_thompson_085 Sep 08 '21 at 13:31
1

The class that caches these values is java.base/sun.net.NetProperties and the .get(String key) method is public static so it should be accessible to a debugger.

dave_thompson_085
  • 34,712
  • 6
  • 50
  • 70
  • Great, I was able to evaluate this in IDEA at a breakpoint and see it: `sun.net.NetProperties.get("jdk.http.ntlm.transparentAuth")` – Solx Sep 15 '21 at 17:47