Failed to create cert for subdomain

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: beta.fwcp.org

I ran this command:
sudo docker run -i --rm --name certbot -v "/docker-volumes/etc/letsencrypt:/etc/letsencrypt" -v "/docker-volumes/var/lib/letsencrypt:/var/lib/letsencrypt" -v "/home/ec2-user/app/certbot:/data/certbot" certbot/certbot certonly -d beta.fwcp.org --standalone --preferred-challenges http

It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for beta.fwcp.org
Waiting for verification...
Challenge failed for domain beta.fwcp.org
http-01 challenge for beta.fwcp.org
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:

  • The following errors were reported by the server:

    Domain: beta.fwcp.org
    Type: connection
    Detail: Fetching
    http://beta.fwcp.org/.well-known/acme-challenge/_eZSjyWhJVL-rZlYYVVva7dpHhI4Cn0d6xAy16MxXQg:
    Connection refused

    To fix these errors, please make sure that your domain name was
    entered correctly and the DNS A/AAAA record(s) for that domain
    contain(s) the right IP address. Additionally, please check that
    your computer has a publicly routable IP address and that no
    firewalls are preventing the server from communicating with the
    client. If you're using the webroot plugin, you should also verify
    that you are serving files from the webroot path you provided.

My web server is (include version):
nginx 1.19.0

The operating system my web server runs on is (include version):
Amazon Linux 2 (EC2)

My hosting provider, if applicable, is:

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.9.0

The error message "To fix these errors, please make sure that your domain name was entered correctly and the DNS A/AAAA record(s) for that domain contain(s) the right IP address. Additionally, please check that your computer has a publicly routable IP address and that no firewalls are preventing the server from communicating with the client" seems straightforward. However, I think that the server is accessible at beta.fwcp.org.

When I run "sudo python -m SimpleHTTPServer 80" on the server, I'm able to hit http://beta.fwcp.org from a browser, and it shows me the output of SimpleHTTPServer. When I shut down SimpleHTTPServer on the server, the browser can't hit it anymore, which strongly suggests that I'm routed to the correct server. I think DNS, firewalls, etc. are set up correctly, at least to get to SimpleHTTPServer.

There doesn't seem to be any information in the log:
sudo ls -l /var/log/letsencrypt/letsencrypt.log
-rw-rw-rw- 1 root root 0 Mar 27 16:41 /var/log/letsencrypt/letsencrypt.log

1 Like

If you use --standalone from within docker you have to expose port 80 of the container on port 80 of the host.

In other words, you're missing a -p 80:80 option in your docker command.

5 Likes

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