HttpClient 4.0 is redesigned such that there is no longer a global
static Protocol registry (among many other nice redesigns). If
possible, I suggest migrating to 4.0.
Alternately, if you must stick with 3.0, you can try to manually
modify the calls to executeMethod so that the URIs have the protocol
hacked out, ie changing myprotocol://host.com to host.com, and passing
a custom protocol.
Sam
On Wed, Apr 30, 2008 at 9:55 AM, Raman Gupta <[EMAIL PROTECTED]> wrote:
> I'm having problems related to HttpClient using a static protocol
> registry.
>
> I have an application that needs to talk SSL to various systems.
> However, each SSL connection needs to use its own SSLContext
> (different key and trust configurations).
>
> Normally, this would be accomplished in HttpClient 3.x by doing:
>
> Protocol.registerProtocol("https1", new Protocol(...));
> Protocol.registerProtocol("https2", new Protocol(...));
> etc.
>
> Unfortunately, for these SSL connections, I am using HttpClient
> indirectly via another library (Spring-WS) that chokes on URLs that
> don't start with https or http.
>
> I figured no problem, I would simply use a different HttpClient
> instance for each unique SSL socket factory, and register the relevant
> protocol as "https" for each. Unfortunately, it seems that all
> HttpClient instances share a single static Protocol registry. Ouch.
>
> To add insult to injury, if I pass in a Protocol instance via the
> executeMethod HostConfiguration parameter, HttpClient says "oops,
> sorry, you're using an absolute URI so I'm going to ignore the
> HostConfiguration you just passed me, and go build a new
> HostConfiguration based on the protocol registry".
>
> Is there any way around this, other than the solution I am immediately
> considering, which is patching the HttpClient codebase to change the
> global static protocol registry to be per-HttpClient?
>
> Cheers,
> Raman Gupta
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]