title: Credentials cannot be used for NTLM authentication
body: <p>I am getting</p>
  <blockquote>
  <p>org.apache.commons.httpclient.auth.InvalidCredentialsException:
  Credentials cannot be used for NTLM authentication:</p>
  </blockquote>
  <p>exception in eclipse</p>
  <p>Whether it is possible mention eclipse to take system proxy settings directly?</p>
  <pre><code>public class HttpGetProxy {
      private static final String PROXY_HOST = &quot;proxy.****.com&quot;;
      private static final int PROXY_PORT = 6050;
  
      public static void main(String[] args) {
          HttpClient client = new HttpClient();
          HttpMethod method = new GetMethod(&quot;https://kodejava.org&quot;);
  
          HostConfiguration config = client.getHostConfiguration();
          config.setProxy(PROXY_HOST, PROXY_PORT);
  
          String username = &quot;*****&quot;;
          String password = &quot;*****&quot;;
          Credentials credentials = new UsernamePasswordCredentials(username, password);
          AuthScope authScope = new AuthScope(PROXY_HOST, PROXY_PORT);
  
          client.getState().setProxyCredentials(authScope, credentials);
  
          try {
              client.executeMethod(method);
  
              if (method.getStatusCode() == HttpStatus.SC_OK) {
                  String response = method.getResponseBodyAsString();
                  System.out.println(&quot;Response = &quot; + response);
              }
          } catch (IOException e) {
              e.printStackTrace();
          } finally {
              method.releaseConnection();
          }
      }
  }
  </code></pre>
  <p>Exception:</p>
  <blockquote>
  <p>Dec 08, 2017 1:41:39 PM
  org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
  INFO: ntlm authentication scheme selected
  Dec 08, 2017 1:41:39 PM org.apache.commons.httpclient.HttpMethodDirector executeConnect
  SEVERE: Credentials cannot be used for NTLM authentication:
  org.apache.commons.httpclient.UsernamePasswordCredentials
  org.apache.commons.httpclient.auth.InvalidCredentialsException: Credentials
  cannot be used for NTLM authentication:
  <code>enter code here</code>
  org.apache.commons.httpclient.UsernamePasswordCredentials
  at org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme.java:332)
  at org.apache.commons.httpclient.HttpMethodDirector.authenticateProxy(HttpMethodDirector.java:320)
  at org.apache.commons.httpclient.HttpMethodDirector.executeConnect(HttpMethodDirector.java:491)
  at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:391)
  at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
  at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
  at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
  at HttpGetProxy.main(HttpGetProxy.java:31)<br />
  Dec 08, 2017 1:41:39 PM org.apache.commons.httpclient.HttpMethodDirector processProxyAuthChallenge
  INFO: Failure authenticating with NTLM @proxy.****.com:6050</p>
  </blockquote>