In Java, you have a couple options:
- Specify the
java.net.ssl*
parameters to setup a cert store, password, etc. You'll want to use keytool
to set up these objects.
Here's the code, or these can be specified on the command line with -D. Note that these will be global to your app.
System.setProperty("javax.net.ssl.keyStore", "myKeyStore.p12");
System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
System.setProperty("javax.net.ssl.keyStorePassword", "password");
- Create a custom
SSLFactory
which configures your certs at a lower level and set it on your WS context. You can google for this and find lots of info out there. Also check this question (the author says it's for JAX-RPC, but in the comments he changes his impl to JAX-WS).
You can find more info in the JSSE docs (this for java 1.5).