Hi,
Can you post the relavant section of the log file?
http://jakarta.apache.org/commons/httpclient/logging.html
Cheers
Ortwin Glück
Azwan Adli Abdullah wrote:
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.
--
[web] http://www.odi.ch/
[blog] http://www.odi.ch/weblog/
[pgp] key 0x81CF3416
finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]