You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Benjamin Janes <Be...@se.ibm.com> on 2005/11/21 08:46:03 UTC

Proxy Authentication

Hi,

I have a site i want to reach

www.mysite.com/index.html

a proxy
proxy.acompany.com
and port
8080

and proxy username and pwd
proxyUser & proxyPwd


how do I set the proxy username / pwd, namlely what is the realm? and and
what do I enter in [[WHAT GOES HERE]],
        myState = new HttpState();
        myState.setCookiePolicy(CookiePolicy.RFC2109);
      .......
                UsernamePasswordCredentials upc = new
UsernamePasswordCredentials(proxyUser ,proxyPwd);
                myState.setProxyCredentials([[WHAT GOES
HERE]],"proxy.acompany.com",upc);
      .......
        myClient.setState(myState);


I have it working for prxies without authentication....

Med vänliga hälsningar/Best regards
Benjamin Janes
------------------------------------------
System Development
IBM Sverige AB
V. Varvsgatan 19, 211 19 Malmö

Cell Phone no.: +46 (0)707 93 62 89
e-mail: benjamin.janes@se.ibm.com


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


Re: Proxy Authentication

Posted by Benjamin Janes <Be...@se.ibm.com>.
Yes

It works with for  proxy without authentication

Med vänliga hälsningar/Best regards
Benjamin Janes
------------------------------------------
System Development
IBM Sverige AB
V. Varvsgatan 19, 211 19 Malmö

Cell Phone no.: +46 (0)707 93 62 89
e-mail: benjamin.janes@se.ibm.com


                                                                           
             Oleg Kalnichevski                                             
             <olegk@apache.org                                             
             >                                                          To 
                                       httpclient-user@jakarta.apache.org  
             2005-11-21 15:19                                           cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: Proxy Authentication            
             "HttpClient User                                              
                Discussion"                                                
                                                                           
                                                                           
                                                                           
                                                                           




On Mon, Nov 21, 2005 at 08:46:03AM +0100, Benjamin Janes wrote:
> Hi,
>
> I have a site i want to reach
>
> www.mysite.com/index.html
>
> a proxy
> proxy.acompany.com
> and port
> 8080
>
> and proxy username and pwd
> proxyUser & proxyPwd
>
>
> how do I set the proxy username / pwd, namlely what is the realm? and and
> what do I enter in [[WHAT GOES HERE]],
>         myState = new HttpState();
>         myState.setCookiePolicy(CookiePolicy.RFC2109);
>       .......
>                 UsernamePasswordCredentials upc = new
> UsernamePasswordCredentials(proxyUser ,proxyPwd);
>                 myState.setProxyCredentials([[WHAT GOES
> HERE]],"proxy.acompany.com",upc);
>       .......
>         myClient.setState(myState);
>
>
> I have it working for prxies without authentication....
>

You do set up proxy in the host config, don't you?

myClient.getHostConfiguration().setProxy(...);

Oleg


> Med v?nliga h?lsningar/Best regards
> Benjamin Janes
> ------------------------------------------
> System Development
> IBM Sverige AB
> V. Varvsgatan 19, 211 19 Malm?
>
> Cell Phone no.: +46 (0)707 93 62 89
> e-mail: benjamin.janes@se.ibm.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>

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




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


Re: Proxy Authentication

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, Nov 21, 2005 at 08:46:03AM +0100, Benjamin Janes wrote:
> Hi,
> 
> I have a site i want to reach
> 
> www.mysite.com/index.html
> 
> a proxy
> proxy.acompany.com
> and port
> 8080
> 
> and proxy username and pwd
> proxyUser & proxyPwd
> 
> 
> how do I set the proxy username / pwd, namlely what is the realm? and and
> what do I enter in [[WHAT GOES HERE]],
>         myState = new HttpState();
>         myState.setCookiePolicy(CookiePolicy.RFC2109);
>       .......
>                 UsernamePasswordCredentials upc = new
> UsernamePasswordCredentials(proxyUser ,proxyPwd);
>                 myState.setProxyCredentials([[WHAT GOES
> HERE]],"proxy.acompany.com",upc);
>       .......
>         myClient.setState(myState);
> 
> 
> I have it working for prxies without authentication....
> 

You do set up proxy in the host config, don't you?

myClient.getHostConfiguration().setProxy(...);

Oleg


> Med v?nliga h?lsningar/Best regards
> Benjamin Janes
> ------------------------------------------
> System Development
> IBM Sverige AB
> V. Varvsgatan 19, 211 19 Malm?
> 
> Cell Phone no.: +46 (0)707 93 62 89
> e-mail: benjamin.janes@se.ibm.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 

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