Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GitterDoneScott/fa062c7d2286d45a195f6c1010004260 to your computer and use it in GitHub Desktop.
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
# 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