From 3439c008e52f6cd261854b5db73fd65cc497b1db Mon Sep 17 00:00:00 2001 From: Adrien DAURIAT <16813527+dauriata@users.noreply.github.com> Date: Wed, 30 Jan 2019 23:32:51 +0100 Subject: [PATCH] acme: Fix loading credentials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move loading credential function before cert renewal call as credentials might be needed for some renewal operations ( ex: DNS ) Signed-off-by: Adrien DAURIAT <16813527+dauriata@users.noreply.github.com> [toke@toke.dk: Port to master branch] Signed-off-by: Toke Høiland-Jørgensen --- net/acme/files/run.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/acme/files/run.sh b/net/acme/files/run.sh index b5dfc731d..b0cae8fa6 100644 --- a/net/acme/files/run.sh +++ b/net/acme/files/run.sh @@ -204,6 +204,12 @@ issue_cert() [ -n "$webroot" ] || [ -n "$dns" ] || pre_checks "$main_domain" || return 1 log "Running ACME for $main_domain" + + handle_credentials() { + local credential="$1" + eval export $credential + } + config_list_foreach "$section" credentials handle_credentials if [ -e "$STATE_DIR/$main_domain" ]; then if [ "$use_staging" -eq "0" ] && is_staging "$main_domain"; then @@ -240,12 +246,6 @@ issue_cert() acme_args="$acme_args --webroot $webroot" fi - handle_credentials() { - local credential="$1" - eval export $credential - } - config_list_foreach "$section" credentials handle_credentials - if ! $ACME --home "$STATE_DIR" --issue $acme_args; then failed_dir="$STATE_DIR/${main_domain}.failed-$(date +%s)" err "Issuing cert for $main_domain failed. Moving state to $failed_dir"