Hi All,

I'm having problem to post to http server which has basic auth enabled and
java client is going through proxy.  I got response authentication
failure.  It seems that no username/password sent to that http server. 
When i remove the proxy, it is ok.

The proxy i'm using is from apache http server 1.3.x, the config is as below:
ProxyRequests On
<Directory proxy:*>
  Order Deny,Allow
  Allow from all
</Directory>


My code is as below:
========================================================
httpClient = new HttpClient();
if (useProxy) {
   HostConfiguration hc = httpClient.getHostConfiguration();
   hc.setProxy(getFwdProxyHost(), Integer.parseInt(getFwdProxyPort()));
}

httpClient.getState().setAuthenticationPreemptive(true);
Credentials defaultcreds = new UsernamePasswordCredentials(httpUsername,
httpPassword);
httpClient.getState().setCredentials(realm, hostName, defaultcreds);
============================================================

I'm using commons-httpclient-2.0.2.jar.  Is there anyone facing this
problem and solved it?

Thanks.


-- 
Azwan Adli Abdullah
Slackweb.net


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to