On Tue, 2013-12-03 at 15:51 +0000, Tobias Woerenkaemper wrote:
> Hi Oleg,
>
> I am using httpclient 4.3.1 and configured my http client like this:
>
> HttpHost tmpProxy = new HttpHost("proxyhost", Integer.parseInt(####));
> AuthScope tmpAuthScope = new AuthScope(tmpProxy);
> BasicCredentialsProvider tmpCredentialsProvider = new
> BasicCredentialsProvider();
> Credentials tmpCredentials = new UsernamePasswordCredentials("username",
> "****");
> tmpCredentialsProvider.setCredentials(tmpAuthScope, tmpCredentials);
>
> RequestConfig tmpRequestConfig = RequestConfig.custom()
> .setConnectTimeout(4000)
> .setProxyPreferredAuthSchemes(Arrays.asList(AuthSchemes.BASIC))
> .setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.BASIC))
> .build();
>
> HttpClient tmpClient = HttpClients.custom()
> .setDefaultRequestConfig(tmpRequestConfig)
> .setProxy(tmpProxy)
> .setDefaultCredentialsProvider(tmpCredentialsProvider)
> .setTargetAuthenticationStrategy(new SummonAuthenticationStrategy())
> .build();
>
> Now I am sending an http request with an Authorization/Authentication header
> since the request target needs basic authentication as well:
>
> HttpGet tmpGetRequest = new HttpGet("target url");
> tmpGetRequest.addHeader("Authorization", ".....");
>
> While being routed through the proxy the (2nd) request seems to lose this
> authentication header and hence I am getting a 401 by the target server.
>
> Best Regards
> Tobias
Tobias,
Could you please post a wire / context log (obfuscated if necessary) of
the session?
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]