Skip to content

Instantly share code, notes, and snippets.

@JuniYadi
Created October 2, 2021 07:48
Show Gist options
  • Save JuniYadi/55600aa63390ad3f67edd0d313afd3b8 to your computer and use it in GitHub Desktop.
Save JuniYadi/55600aa63390ad3f67edd0d313afd3b8 to your computer and use it in GitHub Desktop.
Fixed Expired SSL Let's Encrypt DST CA (Ubuntu/Debian)
#!/bin/bash
ISRG_CHECK=$( openssl x509 -noout -text -in /usr/share/ca-certificates/mozilla/ISRG_Root_X1.crt | grep Issuer | grep "CN = ISRG Root X1" )
if [[ ! $ISRG_CHECK ]]; then
mkdir -p /usr/share/ca-certificates/letsencrypt
curl -o /usr/share/ca-certificates/letsencrypt/ISRG_Root_X1.crt https://letsencrypt.org/certs/isrgrootx1.pem
sed -i 's/mozilla\/DST_Root_CA_X3.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf
echo "letsencrypt/ISRG_Root_X1.crt" | tee -a /etc/ca-certificates.conf
update-ca-certificates
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment