title: SSL-Connection causes javax.net.ssl.SSLException: hostname in certificate didn't match (WSO2 Api Manager / Tomcat)
body: <p>I am currently setting up a dockerized WSO Api Manager. We have got a wildcard certificates for our domain. I successfully transformed it into a java keystore and replaced the two jks files.</p>
  
  <p>When I open the API manager, I get no ssl warnings and the browser marks my connection as secure. </p>
  
  <p>When I try to login I get an error :</p>
  
  <p><a href="https://i.stack.imgur.com/AEY7e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AEY7e.png" alt="enter image description here"></a></p>
  
  <p>In the log files I get :</p>
  
  <pre><code>TID: [-1234] [] [2017-03-24 11:37:55,305]  INFO     
       {org.apache.axis2.transport.http.HTTPSender} - Unable to sendViaPost   
       to    url[https://localhost:9443/services/AuthenticationAdmin]  
       {org.apache.axis2.transport.http.HTTPSender}
  javax.net.ssl.SSLException: hostname in certificate didn't match: 
       &lt;localhost&gt; != &lt;/*.mydomain.io/mydomain.io/*.mydomain.io&gt;
       at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
       at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
  </code></pre>
  
  <p>It looks like the Server is trying to do SSL connections to localhost. So how can I add a matching certificate to the keystore allowing localhost access?</p>
  
  <p>Many thanks!</p>