[prev in list] [next in list] [prev in thread] [next in thread]
List: httpclient-users
Subject: Proxy-Authorization header received on server side
From: Onofer Dusan <Dusan.Onofer () st ! sk>
Date: 2011-02-24 9:15:26
Message-ID: B0C2A47D3129C647BC7D103E04F4216902E47E2D61 () EXCHANGE1 ! st ! sk
[Download RAW message or body]
Hi,
I'm following example
http://hc.apache.org/httpcomponents-client-ga/examples.html
Proxy authentication
but it seems that not only proxy is receiving credentials for proxy.
In log, which is generated at target.host I can see header
Proxy-Authorization: Basic ....
httpclient.getCredentialsProvider().setCredentials(
new AuthScope("proxy.host", 80),
new UsernamePasswordCredentials("proxy_user", "proxy_pass"));
List<String> authpref = new ArrayList<String>();
authpref.add(AuthPolicy.BASIC);
httpclient.getParams().setParameter(AuthPNames.PROXY_AUTH_PREF, authpref);
HttpHost targetHost = new HttpHost("target.host", 443, "https");
HttpHost proxy = new HttpHost("proxy.host", 80);
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
HttpGet httpget = new HttpGet("/path/logrequest.php");
HttpResponse response = httpclient.execute(targetHost, httpget);
I'm using httpclient-4.1.
--d.
--
Dusan Onofer
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic