I use Java 11 (AdoptOpenJDK), keytool uses PKCS12 by default since Java 9, I need a PKCS12 keystore for Jetty 11. Let's Encrypt gives me two pem files. Therefore, I convert those 2 pem files into a PKCS12 keystore with OpenSSL and I use keytool as advised in a tutorial:
openssl pkcs12 -export -inkey /etc/letsencrypt/live/$domainName/privkey.pem -in /etc/letsencrypt/live/$domainName/fullchain.pem -out /etc/letsencrypt/live/$domainName/jetty.pkcs12 -passout "pass:$srcKeystorePassword"
keytool -importkeystore -noprompt -srckeystore /etc/letsencrypt/live/$domainName/jetty.pkcs12 -srcstoretype PKCS12 -srcstorepass $srcKeystorePassword -destkeystore /etc/letsencrypt/live/$domainName/keystore -deststorepass $destKeystorePassword
Isn't the second line useless (except to use another password)? I can't check it by myself right now because I exceeded the weekly limit of Let's Encrypt yesterday and I didn't keep the created pem files. I wrote a script to ease self-hosting, I'd like to remove any unnecessary steps from it.
Could I simply copy the PKCS12 keystore created by OpenSSL? Is there anything subtle I'm missing?