hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Kull (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1479) NPE in DefaultHttpClient with Proxy and AuthCache
Date Mon, 10 Mar 2014 10:20:43 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13925627#comment-13925627
] 

Markus Kull commented on HTTPCLIENT-1479:
-----------------------------------------

The unittest in the descriptions already throws the NPE. I cannot use our internal proxy,
so example.org was used (and without NPE there would be a "not a proxy" error). Do you want
a complete test project with maven dependencies and imports?

> NPE in DefaultHttpClient with Proxy and AuthCache
> -------------------------------------------------
>
>                 Key: HTTPCLIENT-1479
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1479
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.3.3
>            Reporter: Markus Kull
>
> For various reasons we are still using the now deprecated DefaultHttpClient. After updating
to 4.3 we encountered a NullPointerException in a seldom case involving proxies and AuthCache.
> {noformat}
>     @Test
>     public void testDefaultHttpClientProxyAndAuthCache() throws Exception {
>         try (CloseableHttpClient client = new DefaultHttpClient()) {
>             ConnRouteParams.setDefaultProxy(client.getParams(), URIUtils.extractHost(URI.create("http://example.org")));
>             HttpClientContext context = HttpClientContext.create();
>             context.setAuthCache(new BasicAuthCache());
> //          java.lang.NullPointerException (null route)
> //          at org.apache.http.client.protocol.RequestAuthCache.process(RequestAuthCache.java:88)
> //          at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:131)
>             HttpResponse resp = client.execute(new HttpGet("https://www.example.org"),
context);
>             EntityUtils.consumeQuietly(resp.getEntity());
>         }
>     }
> {noformat}
> Thanks in Advance.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message