[Jersey] Securing WebService with glassfish ssl

From: steben <>
Date: Thu, 14 Apr 2011 03:27:01 -0700 (PDT)

I try to secure my web service with glassfish ssl
so I created the server and client certificate, and I trusted the both
certificates with selfsigned certificate of glassfish,
Next I added certificate Realm into Admin console of glassfish, the I add
the definition of security into file configuration web.xml and sun-web.xml
Here is it the web.xml
            Protected resource


and sun-web.xml:

the role name ( match with CN of client certificate that match to
android client application

Now when I try to run the web service it gives me this exception(

here the commands that I used to create a server and client certificates

generate a new certificate in the keystore file, keystore.jks of glassfish

keytool -genkey -alias Server -keyalg RSA -keypass pwd -storepass changeit
-keystore keystore.jks

export the generated certificate to a server.cer

>keytool -export -alias Server -storepass changeit -file server.cer
-keystore keystore.jks
keytool -import -v -trustcacerts -alias keyAlias -file server.cer -keystore
cacerts.jks -keypass changeit -storepass changeit

View this message in context:
Sent from the Jersey mailing list archive at