Skip to content

Commit a73daf7

Browse files
committed
detect old root cert and revoke/regen
1 parent 3f88a30 commit a73daf7

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
331331

332332
## Versions
333333

334+
* **01.10.21:** - Check if the cert uses the old LE root cert, revoke and regenerate if necessary. [Here's more info](https://twitter.com/letsencrypt/status/1443621997288767491) on LE root cert expiration
334335
* **19.09.21:** - Add an optional header to opt out of Google FLoC in `ssl.conf`.
335336
* **17.09.21:** - Mark `SUBDOMAINS` var as optional.
336337
* **01.08.21:** - Add support for ionos dns validation.

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ app_setup_nginx_reverse_proxy_block: ""
155155

156156
# changelog
157157
changelogs:
158+
- { date: "01.10.21:", desc: "Check if the cert uses the old LE root cert, revoke and regenerate if necessary. [Here's more info](https://twitter.com/letsencrypt/status/1443621997288767491) on LE root cert expiration" }
158159
- { date: "19.09.21:", desc: "Add an optional header to opt out of Google FLoC in `ssl.conf`." }
159160
- { date: "17.09.21:", desc: "Mark `SUBDOMAINS` var as optional." }
160161
- { date: "01.08.21:", desc: "Add support for ionos dns validation." }

root/etc/cont-init.d/50-config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,14 @@ else
312312
FILENAME="$DNSPLUGIN.ini"
313313
fi
314314

315+
# Check if the cert is using the old LE root cert, revoke and regen if necessary
316+
if [ -f "/config/keys/letsencrypt/chain.pem" ] && ([ "${CERTPROVIDER}" == "letsencrypt" ] || [ "${CERTPROVIDER}" == "" ]) && ! openssl x509 -in /config/keys/letsencrypt/chain.pem -noout -issuer | grep -q "ISRG Root X"; then
317+
echo "The cert seems to be using the old LE root cert, which is no longer valid. Deleting and revoking."
318+
certbot revoke --non-interactive --cert-path /config/etc/letsencrypt/live/"$ORIGDOMAIN"/fullchain.pem --server $REV_ACMESERVER
319+
rm -rf /config/etc/letsencrypt
320+
mkdir -p /config/etc/letsencrypt
321+
fi
322+
315323
# generating certs if necessary
316324
if [ ! -f "/config/keys/letsencrypt/fullchain.pem" ]; then
317325
if [ "$CERTPROVIDER" = "zerossl" ] && [ -n "$EMAIL" ]; then

0 commit comments

Comments
 (0)