title: Tomcat SSL connection refused
body: <p>I want to do 2way TLS with tomcat, </p>
  
  <p>I configured tomcat as:</p>
  
  <pre><code> &lt;Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
                 maxThreads="150" scheme="https" secure="true"
                 keystoreFile="${user.home}/keystore/keystoregodaddyclient.jks" keystorePass="test"
                 truststoreFile="${user.home}/keystore/keystore.jks" truststorePass="test"      
                 truststoreType="JKS" disableUploadTimeout="true"   
                 enableLookups="true" maxHttpHeaderSize="8192" 
                 maxSpareThreads="75" minSpareThreads="25"
                 clientAuth="true" sslProtocol="TLS" /&gt;
  </code></pre>
  
  <p>I have a certificate and private key from the third party.</p>
  
  <p>I created my "keystore" and trusted" keystore" as follows</p>
  
  <p>Keystore creation:</p>
  
  <p>(a) Create pks keystore.</p>
  
  <pre><code>openssl pkcs12 -export -name clientkey -in godady.crt -inkey server.key -out keystore.p12
  </code></pre>
  
  <p>(b) Import the same to keystore</p>
  
  <pre><code>keytool -importkeystore -destkeystore keystoregodaddyclient.jks -srckeystore keystore.p12 -srcstoretype pkcs12 -alias clientkey
  </code></pre>
  
  <p>(c)I have created the trusted keystore as:</p>
  
  <pre><code>keytool -import -v -trustcacerts -alias clientkey -file godady.crt -keystore keystore.jks 
  </code></pre>
  
  <p>But my request is refused by the server and getting error as:</p>
  
  <pre><code>java.net.SocketException: Software caused connection abort: recv failed
  </code></pre>
  
  <p>Wanted to know if the keystore was correctly formed, because the same works with self signed certificate.</p>