title: JVM to ignore certificate name mismatch
body: <p>I know there were a lot of questions/answers about how to ignore SSL error in the code.</p>
  
  <p>On our dev region <code>dev.domain.tld</code> we have configured a app server over SSL.</p>
  
  <p>The certificate that is displayed is for <code>somedev.domain.tld</code>.</p>
  
  <p>There is no way to change the certificate, it will always be a domain mismatch.</p>
  
  <p>So when I deploy a web-service to <code>https://dev.domain.tld</code> and try to connect/call my webservice I get an exception:</p>
  
  <blockquote>
    <p>Caused by:
    java.security.cert.CertificateException:
    No name matching dev.domain.tld found</p>
  </blockquote>
  
  <p>And I have the <code>somedev.domain.tld</code> CERT in my trust store.</p>
  
  <p>Now, I saw a lot of samples how to change that in the code (using a Trust Manager that accepts all domains), but how do I specify to the JVM to ignore the domain mismatch when connecting to the server? Is there a <code>-Djavax.net.ssl</code> argument or something?</p>
  
  <p>Thank you!</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Or, since I am using Spring-WS, is there a way to set some property in Spring for that? (WebServiceTemplate)</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I guess I'll have to do use something from Spring Security: <a href="http://static.springsource.org/spring-ws/sites/1.5/reference/html/security.html" rel="nofollow noreferrer">http://static.springsource.org/spring-ws/sites/1.5/reference/html/security.html</a></p>