]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: acme: store the TXT record in auth->token
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 24 Mar 2026 20:51:23 +0000 (21:51 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 30 Mar 2026 16:24:28 +0000 (18:24 +0200)
In case of dns-01 challenge, replace the token by the TXT record which
is more pertinent and could be used later to verify if the record is
correct.

src/acme.c

index fe915d6aea3d3350db0b7f7b69eb05b5a1a63cbd..3d762af48f2ac997c4f7025ecfe2a658ca9c319f 100644 (file)
@@ -1730,8 +1730,12 @@ int acme_res_auth(struct task *task, struct acme_ctx *ctx, struct acme_auth *aut
                                goto error;
                        }
 
+                       /* replace the token by the TXT entry */
+                       istfree(&auth->token);
+                       auth->token = istdup(ist2(dns_record->area, dns_record->data));
+
                        send_log(NULL, LOG_NOTICE,"acme: %s: dns-01 requires to set the \"_acme-challenge.%.*s\" TXT record to \"%.*s\" and use the \"acme challenge_ready %s domain %.*s\" command over the CLI\n",
-                                                                    ctx->store->path, (int)auth->dns.len, auth->dns.ptr, (int)dns_record->data, dns_record->area, ctx->store->path, (int)auth->dns.len, auth->dns.ptr);
+                                                                    ctx->store->path, (int)auth->dns.len, auth->dns.ptr, (int)auth->token.len, auth->token.ptr, ctx->store->path, (int)auth->dns.len, auth->dns.ptr);
 
                        /* dump to the "dpapi" sink */
                        line[nmsg++] = ist("acme deploy ");