Skip to content

Instantly share code, notes, and snippets.

@e8035669
Forked from xkr47/letsencrypt-jetty.sh
Last active January 20, 2018 15:33
Show Gist options
  • Save e8035669/199ebdb9b7be33a4cb293c9c0a286bc6 to your computer and use it in GitHub Desktop.
Save e8035669/199ebdb9b7be33a4cb293c9c0a286bc6 to your computer and use it in GitHub Desktop.
How to use Letsencrypt certificate & private key with Jetty
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" script when run with
# the "auth" aka "certonly" subcommand
# convert certificate chain + private key to the PKCS#12 file format
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
# convert PKCS#12 file into Java keystore format
# keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.jks
keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -deststoretype pkcs12 -destkeystore keystore.java.pkcs12
# don't need the PKCS#12 file anymore
rm keystore.pkcs12
# Now use "keystore.jks" as keystore in jetty with the keystore password you specfied when you ran
# the "keytool" command
@e8035669
Copy link
Author

keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -deststoretype pkcs12 -destkeystore keystore.java.pkcs12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment