Wednesday, April 11, 2018

Convert Apache SSL certificates into Tomcat keystore

Found a quick way on some online forum to convert PEM format SSL certificates into Tomcat NIO keystore format.

In Linux, concatenate all *.pem files (cert first, followed by interca cert) into one pem file, like all.pem Then create keystore in p12 format with private key + all.pem
openssl pkcs12 -export -inkey private.key -in all.pem -name test -out test.p12
Then go into Windows, use Java included keytool to export p12 into jks

keytool -importkeystore -srckeystore test.p12 -srcstoretype pkcs12 -destkeystore test.jks

No comments: