Created
August 20, 2019 16:34
-
-
Save GitterDoneScott/fa062c7d2286d45a195f6c1010004260 to your computer and use it in GitHub Desktop.
Docker syntax to include TLS/SSL proxy certificates into ca-certificates and java keystore
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
# Compile and install certificates for the Java trust keystore | |
COPY certs/ /usr/local/share/ca-certificates/ | |
RUN update-ca-certificates && \ | |
ls -1 /usr/local/share/ca-certificates | while read cert; do \ | |
openssl x509 -outform der -in /usr/local/share/ca-certificates/$cert -out $cert.der; \ | |
"$JAVA_HOME/bin/keytool" -import -alias $cert -keystore "$JAVA_HOME/jre/lib/security/cacerts" -trustcacerts -file $cert.der -storepass changeit -noprompt; \ | |
rm $cert.der; \ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment