You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Oleg Kalnichevski <ol...@apache.org> on 2006/03/11 12:02:47 UTC

Re: Need aid with HttpClient and Proxy Setting for basic Authentication

On Sat, 2006-03-11 at 11:32 +0600, Saminda Abeyruwan wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Developers,
> 

Hi Saminda

> I'm using commons-httpclient-3.0 for my project developments. I have a
> use case for connect to Axis2 web server through a Squid proxy with
> basic authentication. At transport level i handle proxy authentication
> as follows, {filtered code}. I have set up the Squid proxy properly and
> varified by the Mozilla Firefox browser.
> 
> 
> ....
> 
> HttpClient httpAgent = new HttpClient();
> 
> PostMethod postMtd = PostMethod(url.toString());
> 
> // i set all other headers and RequestEntiry.
> 
> 
> Credentials proxyCred = new UsernamePasswordCredentials(usrName,passwd);
> 
> HostConfiguration config = new HostConfiguration();
> // i set all proper hostconfig such
> 
> httpAgent.getState().setProxyCredentials(AuthScope.ANY, proxyCred);
> 
> config.setProxy(proxyHostName, proxyPort);
> 
> httpAgent.executeMethod(config, postMethod);
> 
> ...
> 
> Now when i execute this i'm always getting 501.
> 

I believe even in the latest releases Squid supports HTTP/1.0 only. Try
configuring HttpClient to use HTTP/1.0 and see if that makes any
difference.

> 
> 
> And when i run the sample code ProxyTunnelDemo.java {configured for my
> proxy} i'm getting 403.
> 
> Please be kind enough to help me out on this. I've been notified that
> the above code *is* working with java 1.5 but not with java 1.4. What am
> i doing wrong here.
> 
> My JVM is 1.4.2_08_b3 and Ubuntu/Linux.
> 

I can't think of any reason why this problem could be platform/JRE
dependent. 

Please post a complete wire/context log of the HTTP session and I will
take a look at it

http://jakarta.apache.org/commons/httpclient/logging.html

Cheers,

Oleg


> Thank you
> 
> Saminda
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFEEmD+YmklbLuW6wYRArFnAJ0bvoPkPYCaXWm1pFICwJ45ofE9XQCgt2Ji
> RP2JKADgr1Z9WSsGsyIkp/w=
> =UGaG
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org