Skip to content

Instantly share code, notes, and snippets.

@tanapoln
Created April 18, 2017 07:30
Show Gist options
  • Save tanapoln/bef8d3a35d737f55b8a2d8f61d500d4f to your computer and use it in GitHub Desktop.
Save tanapoln/bef8d3a35d737f55b8a2d8f61d500d4f to your computer and use it in GitHub Desktop.
Fix letsencrypt CA error on OSX + java8
#!/bin/bash
set -e
# See Reference: https://github.com/blacklabelops/jenkins/blob/master/Dockerfile
export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
export KEYSTORE=$JAVA_HOME/jre/lib/security/cacerts
wget -P /tmp/ https://letsencrypt.org/certs/letsencryptauthorityx1.der
wget -P /tmp/ https://letsencrypt.org/certs/letsencryptauthorityx2.der
wget -P /tmp/ https://letsencrypt.org/certs/lets-encrypt-x1-cross-signed.der
wget -P /tmp/ https://letsencrypt.org/certs/lets-encrypt-x2-cross-signed.der
wget -P /tmp/ https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.der
wget -P /tmp/ https://letsencrypt.org/certs/lets-encrypt-x4-cross-signed.der
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias isrgrootx1 -file /tmp/letsencryptauthorityx1.der
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias isrgrootx2 -file /tmp/letsencryptauthorityx2.der
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias letsencryptauthorityx1 -file /tmp/lets-encrypt-x1-cross-signed.der
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias letsencryptauthorityx2 -file /tmp/lets-encrypt-x2-cross-signed.der
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias letsencryptauthorityx3 -file /tmp/lets-encrypt-x3-cross-signed.der
keytool -trustcacerts -keystore $KEYSTORE -storepass changeit -noprompt -importcert -alias letsencryptauthorityx4 -file /tmp/lets-encrypt-x4-cross-signed.der
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment