On Wed, 2008-04-30 at 09:55 -0400, Raman Gupta 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".
>
Hi Raman,
Use HostConfigurationWithStickyProtocol from the contrib package to
work the problem around.
Hope this helps
Oleg
> 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]