users@jersey.java.net

Configuring an HttpsURLConnection in Jersey Client

From: Craig McClanahan <Craig.McClanahan_at_Sun.COM>
Date: Thu, 11 Dec 2008 16:17:51 -0800

I've got a use case where I need my server side application to be a
client of other services as well (using Jersey client). These other
services require https (including certificate checking) -- which means I
really need access to the HttpsURLConnection instance being used so I
can do things like customize the trust store and socket factory. (Note
that you can set global defaults for some aspects of this, but that
would apply to all the apps in my server so it's not what I want).

The current Jersey Client handler code for handling requests
(URLConnectionClientHandler) creates a new URLConnection instance for
each request, but provides only limited configuration of it (setting
timeouts and the redirect flag). I'd like to see Jersey Client support
a way to do more sophisticated customization, so I've filed an RFE:

    https://jersey.dev.java.net/issues/show_bug.cgi?id=160

Do you have a similar requirement? You might want to comment on this
RFE (or respond to this message), and watch this issue to keep track of
progress. In the next few days, I'm probably going to have a proposed
patch to support this, if someone else doesn't beat me to it.

Craig