Skip to content

Instantly share code, notes, and snippets.

@richmilne
richmilne / import-letsencrypt-java.sh
Last active December 15, 2021 16:41 — forked from galan/import-letsencrypt-java.sh
Import Let's Encrypt certificates into Java's trusted keystore (cacerts)
View import-letsencrypt-java.sh
#!/bin/bash -e
# A codificiation of the steps outlined at
# https://ordina-jworks.github.io/security/2019/08/14/Using-Lets-Encrypt-Certificates-In-Java.html
CERT_EXT=der
# JAVA_HOME can be passed as argument if not set
if [[ -z ${JAVA_HOME+x} ]] || [[ ! -d ${JAVA_HOME} ]]; then
JAVA_HOME=${1}
fi