Pem and private key creation by certBot failed

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: tcbarter.com

I ran this command: sudo certbot --nginx -d tcbarter.com -d www.tcbarter.com

It produced this output:

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: tcbarter.com
Type: unauthorized
Detail: 2a02:4780:b:849:0:8be:61d8:8: Invalid response from http://tcbarter.com/.well-known/acme-challenge/eXgWIy1Kzcu1QLexuRWv0GnMy7PkN3yK2m1Ovtm--oI: 404

Domain: www.tcbarter.com
Type: unauthorized
Detail: 2a02:4780:b:849:0:8be:61d8:8: Invalid response from http://www.tcbarter.com/.well-known/acme-challenge/H0oQsVPCp6fwL_k9iWGjHWKmBTcHf2eVYSGi7Lhvj4Y: 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): tcbarter.com, VPS

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

My hosting provider, if applicable, is: hostinger

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):

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

A better thread title would be: "authentication failed", because Certbot probably can generate the private key perfectly and Let's Encrypt hasn't even begun to generate a certificate due to the lack of valid authorizations.

The reason of the failed authorizations is probably the incorrect IPv6 address configured in DNS. See Let's Debug for more info. I think this is common on Hostinger (they simply suck).

By the way, your webserver seems to be "nginx". A domain name is not a webserver. While a VPS might function as a webserver (and more), the question really meant the webserver software (notice the "version" question).

1 Like

Osiris has fully diagnosed your problem. It is so common on Hostinger setups that I made the below template with further info.

================================

You have both an IPv4 A record and an IPv6 AAAA record in your DNS

But, the IPv6 address points to a Hostinger service not your server. Hostinger creates this AAAA record automatically for new setups.

You need to update the AAAA address or remove it if you do not support IPv6.

Any client trying to use IPv6 will connect to that Hostinger service instead of your server.
Let's Encrypt favors IPv6 when an AAAA record is present.

See Hostinger article here: How to manage AAAA records | Hostinger Help Center

And use this site to test connections
https://letsdebug.net

3 Likes