Skip to content

acme/http-01: no challenge registered #40

@bmos1

Description

@bmos1

Bug Overview

We configure the nginx-acme module to replace the working certbot solution. The User-Agent EJBCA ACME Challenge Validator/1.0 requests a /.well-known path. The debug error message states acme/http-01: no challenge registered for ... The nginx-acme module responds with 404. Finally we see urn:ietf:params:acme:error:incorrectResponse: Response received didn't match the challenge's requirements in the logs and no certificate is issued.

Expected Behavior

The nginx-acme module provisions the key authorization as a resource an endpoint /.well-known/acme-challenge/TOKEN on the HTTP server for the domain in question.

Steps to Reproduce the Bug

nginx config

pid /var/tmp/nginx/nginx.pid;
error_log /var/tmp/nginx/error.log debug;

load_module modules/ngx_http_acme_module-debug.so;

http {
    # Config access.log for all http servers where nginx has proper write access
    access_log /var/tmp/nginx/access.log;
    
    # Hide Nginx version
    server_tokens off;

    ...

    # Internal DNS resolver
    resolver 1.1.1.1:53;

    # ACME (ngx_http_acme_module is required) 
    acme_issuer pki {
        uri         https://pki.example.com/ejbca/acme/signserver/directory;
        account_key ecdsa:256;
        contact     [email protected];
        state_path  /var/cache/nginx/acme;
        accept_terms_of_service;
    }

    acme_shared_zone zone=ngx_acme_shared:1M;

    server { 
        # listener on port 80 is required to process ACME HTTP-01 challenges 
        listen 80; 

        location / { 
           return 404; 
        }
    }

    server {
        server_name signserver.example.com;

        listen 443 ssl;
        http2 on;

        # ACME (ngx_http_acme_module is required) 
        acme_certificate     pki signserver.example.com key=ecdsa:384;
        ssl_certificate       $acme_certificate; 
        ssl_certificate_key   $acme_certificate_key;
        ssl_certificate_cache max=2;
        
        location / {
        proxy_pass http://127.0.0.1:8082/;
        ...
        }
    }
}

events {

}

Restarting nginx-debug results in requests from the EJBCA ACME Challenge Validator, where all requests result in 404.
The debug error log shows: acme/http-01: no challenge registered for urHN7xquTdZtjrO0R0Q8Iw

sending request to https://pki.example.com/ejbca/acme/signserver/acct/0T8HbZjFyuO5ATyceI6bwg/chall/OdYQJ1C18t9rbxhRw6-HJg

http request line: "GET /.well-known/acme-challenge/urHN7xquTdZtjrO0R0Q8Iw HTTP/1.1"

http process request header line
http header: "Connection: close"
http header: "Host: pki-uctserver01.commend.intern"
http header: "User-Agent: EJBCA ACME Challenge Validator/1.0"
http header: "Accept-Encoding: gzip,deflate"
http header done

acme/http-01: no challenge registered for urHN7xquTdZtjrO0R0Q8Iw
generic phase: 1
rewrite phase: 2
test location: "/"
using configuration "/"
http cl:-1 max:1048576
rewrite phase: 4
http finalize request: 404, "/.well-known/acme-challenge/urHN7xquTdZtjrO0R0Q8Iw?" a:1, c:1
http special response: 404, "/.well-known/acme-challenge/urHN7xquTdZtjrO0R0Q8Iw?"
http set discard body
HTTP/1.1 404 Not Found
Server: nginx
Date: Fri, 22 Aug 2025 07:25:30 GMT
Content-Type: text/html
Content-Length: 146
Connection: close

write new buf t:1 f:0 000056623BBC33D0, pos 000056623BBC33D0, size: 143 file: 0, size: 0
http write filter: l:0 f:0 s:143
http output filter "/.well-known/acme-challenge/urHN7xquTdZtjrO0R0Q8Iw?"
http copy filter: "/.well-known/acme-challenge/urHN7xquTdZtjrO0R0Q8Iw?"
http postpone filter "/.well-known/acme-challenge/urHN7xquTdZtjrO0R0Q8Iw?" 000056623BD50AB0

http write filter: l:1 f:0 s:289
http write filter limit 2097152

http write filter 0000000000000000
http copy filter: 0 "/.well-known/acme-challenge/urHN7xquTdZtjrO0R0Q8Iw?"
http finalize request: 0, "/.well-known/acme-challenge/urHN7xquTdZtjrO0R0Q8Iw?" a:1, c:1
http request count:1 blk:0
http close request
http log handler

close http connection: 3
reusable connection: 0

worker cycle
epoll timer: 59984

SSL_read: 455
SSL_read: 0
SSL_get_error: 6
peer shutdown SSL cleanly
shmtx lock
slab alloc: 105 slot: 4
slab alloc: 00007311171AD080
shmtx unlock
acme certificate "pki/signserver.example.com-f28176657b37216b" request failed: urn:ietf:params:acme:error:incorrectResponse: Response received didn't match the challenge's requirements

Environment Details

Target deployment platform: VPS
Target OS: Ubuntu 24.04
Version of this project or specific commit: 1.29.1+0.1.1-1 (from nginx mainline Ubuntu repo)
Version of any relevant project languages: None

Additional Context

We do NOT believe that it is the IPv6 timeout bug. It looks like the nginx-acme-module does not provide the /.well-known path with the token.
We notice an appendix of ? on each token.

http finalize request: 404, "/.well-known/acme-challenge/urHN7xquTdZtjrO0R0Q8Iw?" a:1, c:1
http special response: 404, "/.well-known/acme-challenge/urHN7xquTdZtjrO0R0Q8Iw?"

http copy filter: 0 "/.well-known/acme-challenge/hTg3_Ya2WjG8SMOpOm5nqg?"
http finalize request: 0, "/.well-known/acme-challenge/hTg3_Ya2WjG8SMOpOm5nqg?" a:1, c:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions