I am using https://zerossl.com for the certificate, they provide me these files:
- ca_bundle.crt
- certficate.crt
- private.key
Then I run these commands
To generate a p12 file
openssl pkcs12 -export -in certificate.crt -inkey private.key -out keystore.p12 -name tomcat -CAfile ca_bundle.crt -caname root -chain To generate the JKS file
keytool -importkeystore -srckeystore certifcate.p12 -srcstoretype pkcs12 -destkeystore mykeystore.jks -deststoretype pkcs12 Then I edit my /opt/tomcat/conf/server.xml
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" keystoreFile="/path/to/your/keystore.jks" keystorePass="your_keystore_password" keyAlias="tomcat" keyPass="your_key_password" clientAuth="false" sslProtocol="TLS" /> I'm not sure why the SSL certificate is not working. I would appreciate if someone tells me if I am missing something.
-destkeystore mykeystore.jks -deststoretype pkcs12: Here you are contradicting yourself. Most probably it should be-destkeystore mykeystore.jks -deststoretype JKS. Otherwise you could use the first keystore created byopenssl, as long asserver.xmlknows that it's a pkcs12 keystore, not JKS.