JBoss Community

Call web services with different certificates

created by Mats Andersson in JBoss Web Services - View the full discussion

I want to call two different web services that uses two different SSL certificates.

The certificates are real certificates and not self signed.

 

The question is how to do this.

i can't use System.setProperty("javax.net.ssl.keyStore", path)

 

in Jboss 4 you could do like this:

UserInterface ui = new SoapService().getUserInterfacePort();

BindingProvider bp = (BindingProvider) ui;

bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,"https://test.com/SoapService");

 

bp.getRequestContext().put("org.jboss.ws.keyStore", path);

bp.getRequestContext().put("org.jboss.ws.keyStoreType", );

bp.getRequestContext().put("org.jboss.ws.keyStorePassword", "password");

 

ui.doSomething();

 

This doesnt work in jboss 6, i get a HTTP 500 from the web service server.

I have also tried bp.getRequestContext().put("javax.net.ssl.keyStore", path)

with the same result.

 

I have found one solution where you use your own SSLSocketFactory but that is no good solution since i will be needing to do the XML sending and parsing myself.

What i want is a nice solution with JAX-WS, if that is possible.

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community