Created
June 7, 2017 12:50
-
-
Save wolkenschieber/0d0efe59a2353ae9e944c3e68b240589 to your computer and use it in GitHub Desktop.
Bundle letsencrypt certificate with full chain in java keystore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit -o nounset | |
DOMAIN="example.com" | |
PASSWORD="changeit" | |
TEMP_PKCS12="temp.p12" | |
KEYSTORE="keystore.jks" | |
openssl pkcs12 -export -in "/etc/letsencrypt/live/${DOMAIN}/fullchain.pem" -inkey "/etc/letsencrypt/live/${DOMAIN}/privkey.pem" -out "${TEMP_PKCS12}" -password pass:"${PASSWORD}" | |
keytool -importkeystore -deststorepass "${PASSWORD}" -destkeypass "${PASSWORD}" -destkeystore "${KEYSTORE}" -srckeystore "${TEMP_PKCS12}" -srcstoretype PKCS12 -srcstorepass "${PASSWORD}" -noprompt | |
rm "${TEMP_PKCS12}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment