Skip to main content

Glassfish web service client using mutual authentication (client certificate)

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
tntrujilo
Offline
Joined: 2012-01-25

I need to create a client to consume a web service protected by mutual authentication. The client will run inside of Glassfish

I how can I provide a client certifcate (from a CA) when communicating with the web service? The web service is provided by another company.

I created a Java SE client that works by setting the System properties:

System.setProperty("javax.net.ssl.keyStore", "D:/mykeystore.jks");
System.setProperty("javax.net.ssl.keyStorePassword", "examplepassword");

When I my client code inside Glassfish, setting the system properties are ignored.