users@jersey.java.net

Re: [Jersey] jersey.api.client.ClientHandlerException

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 01 Jul 2010 15:40:54 +0200

On Jun 30, 2010, at 11:18 PM, Jason Winnebeck wrote:

> This looks like to me a Java SSL problem. I don't know if it is any
> different with the Apache HTTP client, but for the "native" JRE SSL
> you need to have the server with a certificate signed by a
> certificate in the keystore. Java comes with most of the popular CAs
> you would expect (Verisign, Thawte, etc.). But if you have a self-
> signed certificate or a cert signed by a CA not in the Java JRE you
> will need to manually add it to the keystore. I think there's a way
> to set up some class that can verify the key directly (instead of
> letting Java do it automatically), but I don't know how to do it
> offhand. The rest you should be able to find out by searching.
>

Also here is a sample using the default client support with SSL and
Grizzly:

http://download.java.net/maven/2/com/sun/jersey/samples/https-clientserver-grizzly/1.3/https-clientserver-grizzly-1.3-project.zip

Take a close look at the unit test that sets up the client.

The ApacheHTTPClient may have a different approach to setting up the
SSL certs.

Paul.