title: How to provide ntlm authentication while calling any url?
body: <p>I have a hosted url which authenticates using ntlm (windows Integrated authentication). I am on windows and using java 1.8</p>
  
  <pre><code>URL url = new URL("someUrl");
  HttpURLConnection con = (HttpURLConnection) url.openConnection();
  // con.setInstanceFollowRedirects(false);
  con.setRequestProperty("Content-Type", "application/json");
  con.setRequestMethod("GET");
   int responseCode = con.getResponseCode();
              if (responseCode == HttpURLConnection.HTTP_OK) {
              // read response
              ...
              in.close();
              }else{
              System.out.println("Error while fetching reponse, recieved response code " + responseCode);
              }
  </code></pre>
  
  <p>The above code used to work till java 1.8.0_181
   With subsequent updates it started failing, I have tested with 191 and 201.
  The code still works if backported to 181.
  I also tried using Authenticator, but it is not invoked (not sure why)
  With java's internal logging I could see following message in the logs
  <em>"NegotiateAuthentication: java.io.IOException: Negotiate support not initiated"</em>
  And I get 401</p>
  
  <p>I am expecting any mechanism to help java negotiate on its own for authentication.</p>