Issues with using certbot for the first time

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: www.livify.app

I ran this command: sudo certbot --nginx --rsa-key-size 4096 --no-redirect

It produced this output:

[root@ip-172-31-29-237 ec2-user]# sudo certbot --nginx --rsa-key-size 4096 --no-redirect
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: livify.app
2: www.livify.app
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 livify.app and www.livify.app

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
  Domain: livify.app
  Type:   unauthorized
  Detail: 13.57.133.254: Invalid response from http://livify.app/.well-known/acme-challenge/TBMRsp3pv49jT_t7ctjOZ8Qx_Ht8EwX2fMxexwPomz8: 404

  Domain: www.livify.app
  Type:   unauthorized
  Detail: 13.57.133.254: Invalid response from http://www.livify.app/.well-known/acme-challenge/ZkgazTKSZiL2lFL2OP2OwgLnyMDL43h5ggH9GQX55sc: 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

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

My hosting provider, if applicable, is: AWS

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 1.30.0

My guess why this isn't working is possibly because I use an elastic IP which is the one that is on the detail line, Detail: 13.57.133.254, but this is not the same one that prints out when I use ifconfig. I'm not quite sure. Any and all help is extremely appreciated!

1 Like

Welcome to the community @jasonn9538

Yes, normally the Elastic IP is correct. You can confirm the public IP of your server running a command like this too:

curl -4 https://ifconfig.co
curl -6 https://ifconfig.co  (if using IPv6)

Right now it looks like you changed your DNS and using an internal AWS IP. That won't work. If you change your DNS back to the public IP (confirmed using the curl commands) we can look into it more.

Otherwise you get a failure now shown by this Let's Debug test site

3 Likes

@MikeMcQ thanks for your reply. I just reverted the IP that livify.app directs to using the IP address from the ipv4 curl command. Can you take a look again? I receive the same error. Here is the error log with "-v"

[root@ip-172-31-29-237 ec2-user]# sudo certbot --nginx --rsa-key-size 4096 --no-redirect -v
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx

Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: livify.app
2: www.livify.app
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 livify.app and www.livify.app
Performing the following challenges:
http-01 challenge for livify.app
http-01 challenge for www.livify.app
Waiting for verification...
Challenge failed for domain www.livify.app
Challenge failed for domain livify.app
http-01 challenge for www.livify.app
http-01 challenge for livify.app

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
  Domain: www.livify.app
  Type:   unauthorized
  Detail: 13.57.133.254: Invalid response from http://www.livify.app/.well-known/acme-challenge/QhU_nA-sHxBldPnO8Kzxtdf2Yk2hwNCzZvv7YhKtGL0: 404

  Domain: livify.app
  Type:   unauthorized
  Detail: 13.57.133.254: Invalid response from http://livify.app/.well-known/acme-challenge/bRCTx4IxQRpwgomGShrDKHVA9k8Bd_h_WkT7pnBsLVE: 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.

Cleaning up challenges
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.

Is nginx running directly on that AWS instance? And a standard OS nginx install, not a Bitnami setup or something?

4 Likes

schoen asks good questions. The 404 error you got is unusual when using the nginx plug-in as you are. Would be helpful to know more details of your setup. Is it just a plain EC2 instance with nginx?

You might also try restarting the server. It is possible to get in a bad state with two variations of nginx running (under systemd and outside it). If, for example, you tried running certbot --nginx when nginx was not running this can happen and cause problems.

If nothing seems helpful we could look at the full debug log. You can upload it with a post here but may need to copy it to a .txt file first. Or, copy/paste the entire thing (very long) here but then please add 3 backticks before and after like this:

```
pasted contents of /var/log/letsencrypt/letsencrypt.log
```

3 Likes

If all else fails, you might want to try using --webroot authentication.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.