This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting ssl factory for JAX-WS webservice  RSS feed

 
Oliv Anirud
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!