From: Gerhard Schlager <mail@gerhard-schlager.at>
Date: Thu, 31 Oct 2019 20:32:49 +0000 (+0100)
Subject: Try to force certificate issuance on second try
X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2dfb77a35361f5b06bf59648048ed8530c88da57;p=discourse_docker.git

Try to force certificate issuance on second try
---

diff --git a/templates/web.letsencrypt.ssl.template.yml b/templates/web.letsencrypt.ssl.template.yml
index 8774bb0..85324fa 100644
--- a/templates/web.letsencrypt.ssl.template.yml
+++ b/templates/web.letsencrypt.ssl.template.yml
@@ -57,7 +57,7 @@ hooks:
         /usr/sbin/nginx -c /etc/nginx/letsencrypt.conf
 
         issue_cert() {
-          LE_WORKING_DIR="${LETSENCRYPT_DIR}" $$ENV_LETSENCRYPT_DIR/acme.sh --issue -d $$ENV_DISCOURSE_HOSTNAME --keylength $1 -w /var/www/discourse/public
+          LE_WORKING_DIR="${LETSENCRYPT_DIR}" $$ENV_LETSENCRYPT_DIR/acme.sh --issue $2 -d $$ENV_DISCOURSE_HOSTNAME --keylength $1 -w /var/www/discourse/public
         }
 
         cert_exists() {
@@ -71,7 +71,7 @@ hooks:
 
         if ! cert_exists ""; then
           # Try to issue the cert again if something goes wrong
-          issue_cert "4096"
+          issue_cert "4096" "--force"
         fi
 
         LE_WORKING_DIR="${LETSENCRYPT_DIR}" $$ENV_LETSENCRYPT_DIR/acme.sh \
@@ -88,7 +88,7 @@ hooks:
 
         if ! cert_exists "_ecc"; then
           # Try to issue the cert again if something goes wrong
-          issue_cert "ec-256"
+          issue_cert "ec-256" "--force"
         fi
 
         LE_WORKING_DIR="${LETSENCRYPT_DIR}" $$ENV_LETSENCRYPT_DIR/acme.sh \