From: William Lallemand Date: Thu, 24 Apr 2025 08:51:41 +0000 (+0200) Subject: MEDIUM: acme: rename "uri" into "directory" X-Git-Tag: v3.2-dev12~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af73f98a3e2a5dcb73ac6990f56e16aa5b26e599;p=thirdparty%2Fhaproxy.git MEDIUM: acme: rename "uri" into "directory" Rename the "uri" option of the acme section into "directory". --- diff --git a/doc/configuration.txt b/doc/configuration.txt index 80577890f..d50f9c83d 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -5919,17 +5919,18 @@ contact curves When using the ECDSA keytype, configure the curves. The default is P-384. +directory + This keyword configures the directory URL for the CA used by this acme + section. This keyword is mandatory as there is no default URL. + + Example: + directory https://acme-staging-v02.api.letsencrypt.org/directory + keytype Configure the type of key that will be generated. Value can be either "RSA" or "ECDSA". You can also configure the "curves" for ECDSA and the number of "bits" for RSA. By default EC384 keys are generated. -uri - This keyword configures the directory URL for the CA used by this acme - section. This keyword is mandatory as there is no default uri. - - Example: - uri https://acme-staging-v02.api.letsencrypt.org/directory Example: @@ -5945,7 +5946,7 @@ Example: ssl-f-use crt "foo.example.com.pem.ecdsa" acme LE2 domains "foo.example.com.pem,bar.example.com" acme LE1 - uri https://acme-staging-v02.api.letsencrypt.org/directory + directory https://acme-staging-v02.api.letsencrypt.org/directory account /etc/haproxy/account.key contact john.doe@example.com challenge HTTP-01 @@ -5953,7 +5954,7 @@ Example: bits 2048 acme LE2 - uri https://acme-staging-v02.api.letsencrypt.org/directory + directory https://acme-staging-v02.api.letsencrypt.org/directory account /etc/haproxy/account.key contact john.doe@example.com challenge HTTP-01 diff --git a/include/haproxy/acme-t.h b/include/haproxy/acme-t.h index 7addd65e4..585728ef0 100644 --- a/include/haproxy/acme-t.h +++ b/include/haproxy/acme-t.h @@ -12,7 +12,7 @@ struct acme_cfg { char *filename; /* config filename */ int linenum; /* config linenum */ char *name; /* section name */ - char *uri; /* directory URL */ + char *directory; /* directory URL */ struct { char *contact; /* email associated to account */ char *file; /* account key filename */ diff --git a/src/acme.c b/src/acme.c index 7bb3fc1cd..8675877b5 100644 --- a/src/acme.c +++ b/src/acme.c @@ -243,7 +243,7 @@ static int cfg_parse_acme_kws(char **args, int section_type, struct proxy *curpx int err_code = 0; char *errmsg = NULL; - if (strcmp(args[0], "uri") == 0) { + if (strcmp(args[0], "directory") == 0) { if (!*args[1]) { ha_alert("parsing [%s:%d]: keyword '%s' in '%s' section requires an argument\n", file, linenum, args[0], cursection); err_code |= ERR_ALERT | ERR_FATAL; @@ -251,8 +251,8 @@ static int cfg_parse_acme_kws(char **args, int section_type, struct proxy *curpx } if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; - cur_acme->uri = strdup(args[1]); - if (!cur_acme->uri) { + cur_acme->directory = strdup(args[1]); + if (!cur_acme->directory) { err_code |= ERR_ALERT | ERR_FATAL; ha_alert("parsing [%s:%d]: out of memory.\n", file, linenum); goto out; @@ -486,7 +486,7 @@ void deinit_acme() next = acme_cfgs->next; ha_free(&acme_cfgs->name); - ha_free(&acme_cfgs->uri); + ha_free(&acme_cfgs->directory); ha_free(&acme_cfgs->account.contact); ha_free(&acme_cfgs->account.file); ha_free(&acme_cfgs->account.thumbprint); @@ -497,7 +497,7 @@ void deinit_acme() } static struct cfg_kw_list cfg_kws_acme = {ILH, { - { CFG_ACME, "uri", cfg_parse_acme_kws }, + { CFG_ACME, "directory", cfg_parse_acme_kws }, { CFG_ACME, "contact", cfg_parse_acme_kws }, { CFG_ACME, "account", cfg_parse_acme_kws }, { CFG_ACME, "challenge", cfg_parse_acme_kws }, @@ -1540,7 +1540,7 @@ struct task *acme_process(struct task *task, void *context, unsigned int state) switch (st) { case ACME_RESSOURCES: if (http_st == ACME_HTTP_REQ) { - if (acme_http_req(task, ctx, ist(ctx->cfg->uri), HTTP_METH_GET, NULL, IST_NULL) != 0) + if (acme_http_req(task, ctx, ist(ctx->cfg->directory), HTTP_METH_GET, NULL, IST_NULL) != 0) goto retry; }