Can't Issue New Certificate

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: jlamothe.net

I ran this command: certbot --nginx

It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log

Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.


1: jlamothe.net
2: www.jlamothe.net


Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Requesting a certificate for jlamothe.net and www.jlamothe.net

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: jlamothe.net
Type: unauthorized
Detail: 2a01:4f9:c010:ce96::1: Invalid response from http://jlamothe.net/.well-known/acme-challenge/WgucG1idtrdNzqrfI_puCHMh2WUPiJntSDvXbm_ZA1k: 404

Domain: www.jlamothe.net
Type: unauthorized
Detail: 2a01:4f9:c010:ce96::1: Invalid response from http://www.jlamothe.net/.well-known/acme-challenge/HZTsGwuJ64DPzPV03HYp4UkjZADkPt7iLRZWz-M_6Pg: 404

Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.

Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

My web server is (include version): nginx/1.22.1

The operating system my web server runs on is (include version): Debian 12

My hosting provider, if applicable, is: Hetzner

I can login to a root shell on my machine (yes or no, or I don't know): yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 2.1.0

Yes, I know there's a newer version of certbot. I've tried using the snap version with the same result and promptly uninstalled because I hate snaps.

Can you share your nginx server configurations? It seems like certbot's attempt to add the handler for the acme challenge isn't working. There's potentially something in the nginx config.

It looks like your homepage may be static html. If you've already got it serving files off disk, an alternative approach to --nginx is to use certbot's --webroot: User Guide — Certbot 2.6.0 documentation

4 Likes

It's the stock configuration from Debian 12's repository with the following in /etc/nginx/sites-available/jlamothe.net.conf (and symlinked into /etc/nginx/sites-enabled):

server {
    listen 80;
    server_name jlamothe.net www.jlamothe.net;
    if ($host = www.jlamothe.net) {
        return 301 https://jlamothe.net$request_uri;
    }
    location / {
        proxy_set_header Host $host;
        proxy_pass http://192.168.3.100;
    }
}

For additional context the 192.168.3.0/24 IP range is being handled by a WireGuard VPN.

Your DNS has an AAAA record for IPv6 but your nginx is not listening on IPv6. So, inbound requests fail to reach the expected server block.

Your listen for port 80 should look like below and similarly for port 443 when you get to that.

    listen 80;
    listen [::]:80;
3 Likes

Success!

You're awesome. Thanks! :smiley:

2 Likes