title: wsimport from https: [ERROR] java.security.cert.CertificateException: No subject alternative names present
body: <p>I'm trying to generate a webservice client using wsimport from https wsdl:</p>
  
  <pre><code>call wsimport -d bin -s src -p mypackage.ws https://x.x.x.x:8181/services/SomeService?wsdl
  </code></pre>
  
  <p>For solving security errors I added a server's certificate to Java's keystore:</p>
  
  <pre><code>keytool -import -keystore c:\Java\jdk1.6.0_38\jre\lib\security\cacerts -file c:\ca-dev.crt
  </code></pre>
  
  <p>But when I do wsimport error appears:</p>
  
  <p><strong>[ERROR] java.security.cert.CertificateException: No subject alternative names present</strong></p>
  
  <p><strong>Failed to read the WSDL document: <a href="https://x.x.x.x:8181/services/SomeService?wsdl" rel="nofollow">https://x.x.x.x:8181/services/SomeService?wsdl</a>, because 1) could not find the document; /2) the document could not
  be read; 3) the root element of the document is not .</strong></p>
  
  <p><strong>[ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s):</strong></p>
  
  <p><strong>At least one WSDL with at least one service definition needs to be provided</strong>.</p>
  
  <pre><code>    Failed to parse the WSDL.
  </code></pre>
  
  <p><strong>SOLVED!</strong>
  Added entry with name same as certificate's CN to hosts file.</p>