Hi,

Frist, I can pass through a proxy by a BasciAuthentication and connect
target host without Authentication request successfully, but for a target
host need a second

BasciAuthentication,  i donn't know how to operate and set the second
BasciAuthentication params using httpclient4.0 API.

PS: I have read
http://hc.apache.org/httpcomponents-client/tutorial/html/authentication.html
,but
I have no idea to using it
....................
char[] passphrase = CommonParams.strPassPhase.toCharArray();
        DefaultHttpClient httpclient =
CertUtils.getHttpClientWithCustomizedTrustManager(CommonParams.certsFile,
passphrase, CommonParams.host, CommonParams.portNumber);
        if (httpclient == null)
            return;

 // make sure to use a proxy that make a connect
     HttpHost proxy = new
HttpHost(CommonParams.proxyHost,CommonParams.proxyPortNumber);
      httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
proxy);

 HttpHost targetHost = new HttpHost(CommonParams.host,
CommonParams.portNumber, "https");
        System.out.println("executing request: " +
aUriRequest.getRequestLine());
        System.out.println("to target: " + targetHost);

 HttpResponse response = httpclient.execute(targetHost, aUriRequest);
        HttpEntity entity = response.getEntity();
.
.
.


Please help me! you'b better show me a special example ,thx~

Regards,

Jeprotea

Reply via email to