[jboss-user] [JBoss Web Services] - JAXWSProperties.SSL_SOCKET_FACTORY alternative in JBoss

Markus Kilås do-not-reply at jboss.com
Fri May 25 06:49:37 EDT 2012


Markus Kilås [https://community.jboss.org/people/ne1mackan] created the discussion

"JAXWSProperties.SSL_SOCKET_FACTORY alternative in JBoss"

To view the discussion, visit: https://community.jboss.org/message/737901#737901

--------------------------------------------------------------
I have WS clients inside the application server making web services calls out to other servers. I need to specify the SSLSocket factory to be used by the request (as I have custom keystores and trust stores). 

The first obvious solution is to set the default SSLSocketFactory of the HttpsURLConnection:

{code}
// SSLSocketFactory factory = ...
HttpsURLConnection.setDefaultSSLSocketFactory(factory);
{code}

This works fine on both JBoss 5.1.0 and GlassFish 3.1.2 as long as all SSL connections in the VM can use the same truststore/keystore and keys.

However in my case I want to be able to connect to different servers using different keystores and having multiple concurrent requests. This means that setting the SSLSocketFactory globally for the VM is not an option.

Instead the JAX-WS RI offers an way of specifying the SSLSocketFactory per request:
{code}
import com.sun.xml.ws.developer.JAXWSProperties;
...
EjbcaWS ejbca = service.getEjbcaWSPort();
BindingProvider binding = (BindingProvider) ejbca;
Map<String, Object> requestContext = binding.getRequestContext();
requestContext.put(JAXWSProperties.SSL_SOCKET_FACTORY, factory);
{code}

This achieves exactly the functionality I need and works perfect on GlassFish, however the property is ignored by JBoss 5.1.0.GA-jdk6.

*Is there a similar property that JBoss uses or how can I achive different SSL socket factories per request?*
*
*
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/737901#737901]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120525/286f8668/attachment.html 


More information about the jboss-user mailing list