{"id":1817,"date":"2013-01-21T14:40:56","date_gmt":"2013-01-21T06:40:56","guid":{"rendered":"http:\/\/rmohan.com\/?p=1817"},"modified":"2013-01-21T14:40:56","modified_gmt":"2013-01-21T06:40:56","slug":"convert-an-openssl-apache-ssl-certificate-to-a-pkcs12-tomcat","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=1817","title":{"rendered":"Convert an OpenSSL (Apache) SSL Certificate to a PKCS12 (Tomcat)"},"content":{"rendered":"<p>Convert the Key to a PKCS12 Key. This will prompt you for a password which you will need when you change the Tomcat configuration.<\/p>\n<p>openssl pkcs12 -export -in \/etc\/apache2\/ssl.crt\/somedomain.com.crt -out somedomain.com.pkcs12 -name \u201csomedomain.com\u201d -inkey \/etc\/apache2\/ssl.key\/somedomain.com.com.key<\/p>\n<p>Verify that the pkcs12 file contains your key. You should be able to see your certificate\u2019s common name, and various other parameters.<\/p>\n<p>keytool -list -v -keystore somedomain.com.pkcs12 -storetype pkcs12<\/p>\n<p>Now configure Tomcat by editing conf\/server.xml and changing the SSL Connector to something like this:<\/p>\n<pre>&lt;connector port=\"8443\" maxThreads=\"150\" acceptCount=\"100\" debug=\"0\" scheme=\"https\" secure=\"true\"\r\nclientAuth=\"false\" sslProtocol=\"TLS\"\r\nkeystoreType= \"PKCS12\"\r\nkeystoreFile=\"somedomain.pkcs12\"\r\nkeystorePass=\"yourKeystorePass\"&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Convert the Key to a PKCS12 Key. This will prompt you for a password which you will need when you change the Tomcat configuration.<\/p>\n<p>openssl pkcs12 -export -in \/etc\/apache2\/ssl.crt\/somedomain.com.crt -out somedomain.com.pkcs12 -name \u201csomedomain.com\u201d -inkey \/etc\/apache2\/ssl.key\/somedomain.com.com.key<\/p>\n<p>Verify that the pkcs12 file contains your key. You should be able to see your certificate\u2019s common name, and various [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1817"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1817"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1817\/revisions"}],"predecessor-version":[{"id":1819,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/1817\/revisions\/1819"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}