You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Michael Becke <be...@u.washington.edu> on 2003/01/08 03:46:27 UTC
Re: [PATCH] Fix for NullPointerException in HttpMethodBase
Wow. I just realized that I submitted almost the exact same patch,
except a few days late:) Boy do I feel stupid.
Mike
On Sunday, December 29, 2002, at 06:15 PM, Maarten Coene wrote:
> Hi,
>
> I get a NullPointerException if I construct a HttpMethod with an query
> uri.
> Here is a patch to fix this.
>
> I've also included a unit test for this bug (see attachment).
>
> regards,
> Maarten Coene
>
>
> cvs diff -u HttpMethodBase.java
> Index: HttpMethodBase.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/
> commons/httpc
> lient/HttpMethodBase.java,v
> retrieving revision 1.93
> diff -u -r1.93 HttpMethodBase.java
> --- HttpMethodBase.java 20 Dec 2002 09:22:07 -0000 1.93
> +++ HttpMethodBase.java 29 Dec 2002 23:06:12 -0000
> @@ -302,7 +302,7 @@
> if (pa < 0) { //its just a path
> setPath(uri);
> } else { //its a path with a query
> - setPath(path.substring(0, pa));
> + setPath(uri.substring(0, pa));
> setQueryString(uri.substring(pa+1, uri.length()));
> }
> }
>
>
> cvs diff -u TestNoHost.java
> Index: TestNoHost.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-commons/httpclient/src/test/org/apache/
> commons/httpc
> lient/TestNoHost.java,v
> retrieving revision 1.16
> diff -u -r1.16 TestNoHost.java
> --- TestNoHost.java 3 Dec 2002 15:28:18 -0000 1.16
> +++ TestNoHost.java 29 Dec 2002 23:13:37 -0000
> @@ -101,6 +101,7 @@
> suite.addTest(TestStreams.suite());
> suite.addTest(TestStatusLine.suite());
> suite.addTest(TestPartsNoHost.suite());
> + suite.addTest(TestHttpMethodBase.suite());
> return suite;
> }
>
>
> <TestHttpMethodBase.java>--
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
Re: HttpClient and multiple client certificates
Posted by Simon Roberts <si...@fifthweb.net>.
> > What would be the "correct" way to use HttpClient in a situation where
we
> > have multiple client certificates, talking to the same server? Register
a
> > bunch of Protocols, each of which had their own SSLSocketFactory?
>
> I guess this is the only way.
Nope, that doesn't work - MultiThreadedHttpConnectionManager uses >>host +
":" + port<< for the key for it's connection pool, disregarding the
protocol. If I add a protocol-specific string to the key used in the
Protocols map, it seems to work okay.
Re: HttpClient and multiple client certificates
Posted by Ortwin Glück <or...@nose.ch>.
Simon Roberts wrote:
> What would be the "correct" way to use HttpClient in a situation where we
> have multiple client certificates, talking to the same server? Register a
> bunch of Protocols, each of which had their own SSLSocketFactory?
I guess this is the only way.
HttpClient and multiple client certificates
Posted by Simon Roberts <si...@fifthweb.net>.
What would be the "correct" way to use HttpClient in a situation where we
have multiple client certificates, talking to the same server? Register a
bunch of Protocols, each of which had their own SSLSocketFactory?