title: How to disable certificate validation in JAX-WS Client?
body: <p>How do you disable certificate validation in JAX-WS client using <code>javax.xml.ws.Service</code>? </p>
  
  <p>I tried creating an all-trusting TrustManager in the SSLSocketFactory and tried to bind it with BindingProvider </p>
  
  <pre><code>SSLContext sc = SSLContext.getInstance("SSL"); 
  sc.init(null, trustAllCerts, new java.security.SecureRandom()); 
  
  Map&lt;String, Object&gt; ctxt = ((BindingProvider) wsport ).getRequestContext(); 
  ctxt.put(JAXWSProperties.SSL_SOCKET_FACTORY, sc.getSocketFactory()); 
  </code></pre>
  
  <p>but I still getting <code>Exception: unable to find valid certification path to requested target</code> </p>
  
  <p>But it works when I just use </p>
  
  <pre><code>HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); 
  </code></pre>
  
  <p>Or is there a way to make <code>javax.xml.ws.Service</code> use the <code>HttpsURLConnection</code> that I created? </p>