This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes How to disable certificate validation in JAX-WS Client? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to disable certificate validation in JAX-WS Client?" Watch "How to disable certificate validation in JAX-WS Client?" New topic
Author

How to disable certificate validation in JAX-WS Client?

John Austran
Greenhorn

Joined: Sep 13, 2012
Posts: 2
How to disable certificate validation in JAX-WS client using javax.xml.ws.Service?

I try creating an all-trusting TrustManager in the SSLSocketFactory and try to bind it with BindingProvider

SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());

Map<String, Object> ctxt = ((BindingProvider) wsport ).getRequestContext();
ctxt.put(JAXWSProperties.SSL_SOCKET_FACTORY, sc.getSocketFactory());

but I still getting Exception: unable to find valid certification path to requested target

But it works when I just use HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());

Or is there a way to make javax.xml.ws.Service to use the HttpsURLConnection that I create?
 
Consider Paul's rocket mass heater.
 
subject: How to disable certificate validation in JAX-WS Client?
 
Similar Threads
Setting time out for web service call
Change address location webservice
JAX-WS - understanding BindingProvider
Printing request object xml
Pass object from a webservice client to the MessageContext