I am trying to transfer a client certificate to a web service using a JAX-RPC implementation. (rpc style web service).
So far, I could do this by setting the system properties:
System.setProperty("javax.net.ssl.keyStore", "client_cert.p12"); System.setProperty("javax.net.ssl.keyStorePassword", "newpasswd"); System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
and then create and call the web service:
CertificateInfoPortType svc = new CertificateInfoLocator().getCertificateInfo(new URL(SERVICE_URL)); svc.methodToBeInvoked();
But since it will be used internally by EJB, I donβt want to set JVM-wide parameters using System.setProperty , as this will affect all web service clients.
Is there a way to pass the client certificate as a parameter? From what I was able to read, I have to use a custom KeyManager , but I do not know how to configure the client KeyManager for the client.
Thanks!
source share