Forked from hedefalk/install-letsencrypt-in-jdk.sh
Last active
April 12, 2016 22:00
-
-
Save felipebn/54ef71bb5309554f0571eef627e65a8a to your computer and use it in GitHub Desktop.
Shell script to update a keystore with lets encrypt cross signatures
This file contains 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 | |
#Updates a keystore with lets encrypt cross signatures | |
[ $# -eq 0 ] && { echo "Usage: $0 <path to keystore>" ; exit 1; } | |
KEYSTORE=$1 | |
wget https://letsencrypt.org/certs/isrgrootx1.pem | |
wget https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.der | |
wget https://letsencrypt.org/certs/lets-encrypt-x4-cross-signed.der | |
# to be idempotent | |
keytool -delete -alias isrgrootx1 -keystore $KEYSTORE -storepass changeit 2> /dev/null | |
keytool -delete -alias letsencryptauthorityx3 -keystore $KEYSTORE -storepass changeit 2> /dev/null | |
keytool -delete -alias letsencryptauthorityx4 -keystore $KEYSTORE -storepass changeit 2> /dev/null | |
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias isrgrootx1 -file isrgrootx1.pem | |
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias letsencryptauthorityx3 -file lets-encrypt-x3-cross-signed.der | |
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias letsencryptauthorityx4 -file lets-encrypt-x4-cross-signed.der | |
rm isrgrootx1.pem lets-encrypt-x3-cross-signed.der lets-encrypt-x4-cross-signed.der |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've forked the original to keep it and change the script to be able to point out which keystore should be updated.