aspose file tools
The moose likes Web Services and the fly likes Setting ssl factory for JAX-WS webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Setting ssl factory for JAX-WS webservice" Watch "Setting ssl factory for JAX-WS webservice" New topic
Author

Setting ssl factory for JAX-WS webservice

Oliv Anirud
Greenhorn

Joined: Mar 08, 2010
Posts: 2
I'm connecting to many web services with the same WSDL definition at different locations, where each of them has different untrusted CAs, that can be changed at any time. For this, I created a SSLSocketFactory that contains the right CA depending on where I connect to, and a SSL client certificate.

The problem is, that the only way I'm able to do it is to set the default ssl factory using HttpsURLConnection.setDefaultSSLSocketFactory(sslfactory). But I need to synchronize on global object to prevent simultaneous connections to overwrite each others factory. Secondly, in future we want to deploy another application to the same application server, which could not synchronize.

I tried to set the JAXWSProperties.SSL_SOCKET_FACTORY to the RequestContext, but it is only available after calling the MyService constructor, which already connects to get the wsdl file.

Is there any way to set the ssl factory just for a particular connection?

Thanks for any help.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Setting ssl factory for JAX-WS webservice
 
Similar Threads
Question for the experts!
Can I override all web applications with global web.xml settings?
Switching between SSL and non SSL mode using custom RMI socket factory
Locking on a static object
SSL Between two instances of tomcat.