From 4098ab51619be20206875bd28ae9e3bd605a78f8 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 29 Sep 2021 22:44:38 +0200 Subject: [PATCH] Upgrade acme.sh before requesting a certificate. --- templates/acme-sh-cron-command.sh.j2 | 1 + templates/acme-sh-request-cert.sh.j2 | 2 ++ 2 files changed, 3 insertions(+) diff --git a/templates/acme-sh-cron-command.sh.j2 b/templates/acme-sh-cron-command.sh.j2 index fd42486..eef6492 100644 --- a/templates/acme-sh-cron-command.sh.j2 +++ b/templates/acme-sh-cron-command.sh.j2 @@ -14,6 +14,7 @@ else exit 1 fi +$ACME_SH_BIN --upgrade $ACME_SH_BIN --cron --home "$ACME_SH_BINDIR" --config-home "$ACME_SH_CONFIG_HOME" > "$ACME_SH_CRON_LOG_FILE" 2>&1 exit $? diff --git a/templates/acme-sh-request-cert.sh.j2 b/templates/acme-sh-request-cert.sh.j2 index 0225058..3974d7d 100644 --- a/templates/acme-sh-request-cert.sh.j2 +++ b/templates/acme-sh-request-cert.sh.j2 @@ -30,6 +30,7 @@ if [ ! -f "$ACME_SH_CONFIG_HOME/ok_certificate_issued" ] && [ "$ACME_SH_USE_DNS_ service apache2 stop >/dev/null 2>&1 service httpd stop >/dev/null 2>&1 fi + $ACME_SH_BIN --upgrade $ACME_SH_BIN {{ letsencrypt_acme_sh_specific_root_ca }} $ACME_SH_FIRST_CERT_REQUEST > "$ACME_SH_ISSUE_LOG_FILE" 2>&1 RETVAL=$? if [ -x /bin/systemctl ] ; then @@ -42,6 +43,7 @@ if [ ! -f "$ACME_SH_CONFIG_HOME/ok_certificate_issued" ] && [ "$ACME_SH_USE_DNS_ service httpd start >/dev/null 2>&1 fi else + $ACME_SH_BIN --upgrade $ACME_SH_BIN {{ letsencrypt_acme_sh_specific_root_ca }} $ACME_SH_ISSUE_CERT_REQUEST > "$ACME_SH_ISSUE_LOG_FILE" 2>&1 RETVAL=$? fi