title: Using HttpProxy to connect to a host with preemtive authentication
body: <p>I am using HttpClient to connect to a host which requires BasicAUTH. But the proxy doesn't require any authentication. I have set it up as follows:</p>
  
  <pre><code>private final HttpClient httpClient; // Spring injected
  </code></pre>
  
  <p>Setting Basic auth:</p>
  
  <pre><code>private void setBasicAuth(final String username, final String password) {
      httpClient.getState().setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, AuthScope.ANY_REALM), new UsernamePasswordCredentials(username, password));
      httpClient.getParams().setAuthenticationPreemptive(true);
  }
  </code></pre>
  
  <p>Setting proxy:</p>
  
  <pre><code>private void setProxy(final String proxyHost, final int proxyPort) {
      hostConfiguration hostConfiguration = httpClient.getHostConfiguration();
      hostConfiguration.setProxy(proxyHost, proxyPort);
  }
  </code></pre>
  
  <p>But I get the following warnings when running the code. Everything works, but I want to get rid of the warnings as well (or at least understand why they appears)</p>
  
  <pre><code>WARN  o.a.c.httpclient.HttpMethodDirector - Required proxy credentials not available for BASIC &lt;any realm&gt;@proxy.XXXXXX.no:3128
  WARN  o.a.c.httpclient.HttpMethodDirector - Preemptive authentication requested but no default proxy credentials available
  </code></pre>
  
  <p>Any ideas?</p>