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 Arunkumar Dubagunta <Ad...@1800FLOWERS.com> on 2006/11/27 20:45:40 UTC

Null values are getting passed for Proxy Crendentials.

Hi,

  I'm trying to pass the proxy credentails through the following lines of code.

     httpClient.getHostConfiguration().setProxy("myproxy", 8080);
			
   AuthScope as = new AuthScope("myproxy",8080);
			
   httpClient.getState().setProxyCredentials(as, new NTCredentials("user", "password","mycomptername","mydomain"));
			
   System.out.println("httpClient Proxy :: " + httpClient.getHostConfiguration().getProxyHost());
			
   System.out.println("httpClient Credentials Object :: " + httpClient.getState().getCredentials(as));
			

   Output: 

      httpClient Proxy :: myproxy
   httpClient Credentials Object :: null


   Please let me know whether I'm missing something while setting the Proxy credentils


Thanks,
Arun Kumar Dubagunta





-----------------------------------------
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or
entity to which it is addressed. If the reader of this e-mail is
not the intended recipient or his or her authorized agent, the
reader is hereby notified that any dissemination, distribution or
copying of this e-mail is prohibited. If you have received this
e-mail in error, please notify the sender by replying to this
message and delete this e-mail immediately.

Re: Null values are getting passed for Proxy Crendentials.

Posted by Roland Weber <ht...@dubioso.net>.
Hi,

>    httpClient.getState().setProxyCredentials(as, new NTCredentials("user", "password","mycomptername","mydomain"));
>    System.out.println("httpClient Credentials Object :: " + httpClient.getState().getCredentials(as));
> 
>    Please let me know whether I'm missing something while setting the Proxy credentils


Use  HttpState.getProxyCredentials(...) rather
than HttpState.getCredentials(...)

hope that helps,
  Roland

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