From: Stefan Eissing Date: Tue, 8 Feb 2022 12:28:37 +0000 (+0000) Subject: * mod_md) do not interfere with requests to /.well-known/acme-challenge/ X-Git-Tag: 2.4.53-rc1-candidate~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=960d719aa31c35a8aac99b1fa413df7a91085bbd;p=thirdparty%2Fapache%2Fhttpd.git * mod_md) do not interfere with requests to /.well-known/acme-challenge/ resources if challenge type 'http-01' is not configured for a domain. Fixes . git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1897865 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/changes-entries/md_ignore_http_challenges.txt b/changes-entries/md_ignore_http_challenges.txt new file mode 100644 index 00000000000..e13b7a284c4 --- /dev/null +++ b/changes-entries/md_ignore_http_challenges.txt @@ -0,0 +1,4 @@ + * mod_md) do not interfere with requests to /.well-known/acme-challenge/ + resources if challenge type 'http-01' is not configured for a domain. + Fixes . + [Stefan Eissing] diff --git a/modules/md/mod_md.c b/modules/md/mod_md.c index e8b625038ac..bb939d26294 100644 --- a/modules/md/mod_md.c +++ b/modules/md/mod_md.c @@ -1359,6 +1359,15 @@ static int md_http_challenge_pr(request_rec *r) name = r->parsed_uri.path + sizeof(ACME_CHALLENGE_PREFIX)-1; reg = sc && sc->mc? sc->mc->reg : NULL; + if (md && md->ca_challenges + && md_array_str_index(md->ca_challenges, MD_AUTHZ_CHA_HTTP_01, 0, 1) < 0) { + /* The MD this challenge is for does not allow http-01 challanges, + * we have to decline. See #279 for a setup example where this + * is necessary. + */ + return DECLINED; + } + if (strlen(name) && !ap_strchr_c(name, '/') && reg) { md_store_t *store = md_reg_store_get(reg);