From: William Lallemand Date: Mon, 28 Apr 2025 15:37:21 +0000 (+0200) Subject: MINOR: acme: failure when no directory is specified X-Git-Tag: v3.2-dev13~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2dd6dd72b8bc4711b34e1cd120ebc275be18d0e;p=thirdparty%2Fhaproxy.git MINOR: acme: failure when no directory is specified The "directory" parameter of the acme section is mandatory. This patch exits with an alert when this parameter is not found. --- diff --git a/src/acme.c b/src/acme.c index ced64445c..39c7a2b16 100644 --- a/src/acme.c +++ b/src/acme.c @@ -413,12 +413,19 @@ static int cfg_postsection_acme() path = cur_acme->account.file; + if (!cur_acme->directory) { + err_code |= ERR_ALERT | ERR_FATAL | ERR_ABORT; + ha_alert("acme: No directory defined in ACME section '%s'.\n", cur_acme->name); + goto out; + } + store = ckch_store_new(path); if (!store) { ha_alert("acme: out of memory.\n"); err_code |= ERR_ALERT | ERR_FATAL | ERR_ABORT; goto out; } + /* tries to open the account key */ if (stat(path, &st) == 0) { if (ssl_sock_load_key_into_ckch(path, NULL, store->data, &errmsg)) {