My domain is:
obfuscated
I ran this command:
certbot certonly --agree-tos --keep --text --email obfuscated --server https://acme-staging-v02.api.letsencrypt.org/directory -d obfuscated --http-01-port 1337 --standalone --preferred-challenges http-01 --debug
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 obfuscated
Waiting for verification...
Challenge failed for domain obfuscated
http-01 challenge for obfuscated
Cleaning up challenges
Exiting abnormally:
Traceback (most recent call last):
File "/usr/local/bin/certbot", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/certbot/main.py", line 15, in main
return internal_main.main(cli_args)
File "/usr/local/lib/python3.7/dist-packages/certbot/_internal/main.py", line 1347, in main
return config.func(config, plugins)
File "/usr/local/lib/python3.7/dist-packages/certbot/_internal/main.py", line 1233, in certonly
lineage = _get_and_save_cert(le_client, config, domains, certname, lineage)
File "/usr/local/lib/python3.7/dist-packages/certbot/_internal/main.py", line 121, in _get_and_save_cert
lineage = le_client.obtain_and_enroll_certificate(domains, certname)
File "/usr/local/lib/python3.7/dist-packages/certbot/_internal/client.py", line 409, in obtain_and_enroll_certificate
cert, chain, key, _ = self.obtain_certificate(domains)
File "/usr/local/lib/python3.7/dist-packages/certbot/_internal/client.py", line 343, in obtain_certificate
orderr = self._get_order_and_authorizations(csr.data, self.config.allow_subset_of_names)
File "/usr/local/lib/python3.7/dist-packages/certbot/_internal/client.py", line 390, in _get_order_and_authorizations
authzr = self.auth_handler.handle_authorizations(orderr, best_effort)
File "/usr/local/lib/python3.7/dist-packages/certbot/_internal/auth_handler.py", line 91, in handle_authorizations
self._poll_authorizations(authzrs, max_retries, best_effort)
File "/usr/local/lib/python3.7/dist-packages/certbot/_internal/auth_handler.py", line 180, in _poll_authorizations
raise errors.AuthorizationError('Some challenges have failed.')
certbot.errors.AuthorizationError: Some challenges have failed.
Please see the logfiles in /var/log/letsencrypt for more details.
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: obfuscated
Type: connection
Detail: Fetching
http://obfuscated/.well-known/acme-challenge/1Nq67fUeLXrxMoYQt_-U3fI1vKIgKx6ba4CcYjr4IdM:
Timeout during connect (likely firewall problem)
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, combined with Certbot 1.5.0 in this docker image: https://github.com/staticfloat/docker-nginx-certbot
The operating system my web server runs on is (include version):
Ubuntu 20.04 LTS
My hosting provider, if applicable, is:
NA
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.5.0
I’m trying to get a certificate using the docker Image I linked earlier. The automatic process failing so I started debugging but have hit a dead end.
Initially I noticed that while Certbot was trying to verify my site, the Nginx log did show a request coming from the load balancers’s IP (forwarding the request of the LE verification server presumably) to collect the challenge response, and nginx returned a 200.
So next thing I did was set up a tcpdump
monitoring session on the host server that runs this docker container, and there I could also verify the challenge response being returned to my LB’s IP:
09:22:43.641352 IP (tos 0x0, ttl 62, id 18659, offset 0, flags [DF], proto TCP (6), length 313)
10.51.11.103.46734 > 172.18.0.14.80: Flags [P.], cksum 0xc57a (correct), seq 1:274, ack 1, win 229, length 273: HTTP, length: 273
GET /.well-known/acme-challenge/1Nq67fUeLXrxMoYQt_-U3fI1vKIgKx6ba4CcYjr4IdM HTTP/1.1
Host: obfuscated
User-Agent: Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)
Accept: */*
Accept-Encoding: gzip
Connection: close
09:22:43.641358 IP (tos 0x0, ttl 62, id 18659, offset 0, flags [DF], proto TCP (6), length 313)
10.51.11.103.46734 > 172.18.0.14.80: Flags [P.], cksum 0xc57a (correct), seq 1:274, ack 1, win 229, length 273: HTTP, length: 273
GET /.well-known/acme-challenge/1Nq67fUeLXrxMoYQt_-U3fI1vKIgKx6ba4CcYjr4IdM HTTP/1.1
Host: obfuscated
User-Agent: Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)
Accept: */*
Accept-Encoding: gzip
Connection: close
09:22:43.641370 IP (tos 0x0, ttl 64, id 13051, offset 0, flags [DF], proto TCP (6), length 40)
172.18.0.14.80 > 10.51.11.103.46734: Flags [.], cksum 0xc1d4 (incorrect -> 0xff49), ack 274, win 501, length 0
09:22:43.641370 IP (tos 0x0, ttl 64, id 13051, offset 0, flags [DF], proto TCP (6), length 40)
172.18.0.14.80 > 10.51.11.103.46734: Flags [.], cksum 0xc1d4 (incorrect -> 0xff49), ack 274, win 501, length 0
09:22:43.642807 IP (tos 0x0, ttl 64, id 13052, offset 0, flags [DF], proto TCP (6), length 263)
172.18.0.14.80 > 10.51.11.103.46734: Flags [P.], cksum 0xc2b3 (incorrect -> 0x5582), seq 1:224, ack 274, win 501, length 223: HTTP, length: 223
HTTP/1.1 200 OK
Server: nginx/1.19.0
Date: Fri, 14 Aug 2020 07:22:43 GMT
Transfer-Encoding: chunked
Connection: close
57
1Nq67fUeLXrxMoYQt_-U3fI1vKIgKx6ba4CcYjr4IdM.akD02rC-U7IEe3TjDIy3F7sjnc8l_xu5J9SMt7c32lc
0
09:22:43.642807 IP (tos 0x0, ttl 64, id 13052, offset 0, flags [DF], proto TCP (6), length 263)
172.18.0.14.80 > 10.51.11.103.46734: Flags [P.], cksum 0xc2b3 (incorrect -> 0x5582), seq 1:224, ack 274, win 501, length 223: HTTP, length: 223
HTTP/1.1 200 OK
Server: nginx/1.19.0
Date: Fri, 14 Aug 2020 07:22:43 GMT
Transfer-Encoding: chunked
Connection: close
57
1Nq67fUeLXrxMoYQt_-U3fI1vKIgKx6ba4CcYjr4IdM.akD02rC-U7IEe3TjDIy3F7sjnc8l_xu5J9SMt7c32lc
0
To be 100% sure that my setup was working, I ran the certbot command again with the --debug-challenges
flag, which allowed me to test the challenge response retrieval before initiating the LE verification. I was indeed able to retrieve the response using both my home internet connection and my smartphone’s 4G connection (2 different ISP’s, no VPN’s).
So what could this be?
My server allows inbound traffic on TCP ports 80 and 443 (through a load balancer) and allows outbound traffic to the internet on TCP ports 80 and 443 as well.