Certbot webroot timeout issue when request 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. https://crt.sh/?q=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: feros.fza.hs-kempten.de

I ran this command: certbot certonly --debug --test-cert --webroot -w /var/www/feros/ -d feros.fza.hs-kempten.de

It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Starting new HTTPS connection (1): acme-staging.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for feros.fza.hs-kempten.de
Using the webroot path /var/www/feros for all unmatched domains.
Waiting for verification…
Cleaning up challenges
Unable to clean up challenge directory /var/www/feros/.well-known/acme-challenge
Traceback (most recent call last):
File “/usr/bin/certbot”, line 11, in
load_entry_point(‘certbot==0.10.2’, ‘console_scripts’, ‘certbot’)()
File “/usr/lib/python2.7/dist-packages/certbot/main.py”, line 849, in main
return config.func(config, plugins)
File “/usr/lib/python2.7/dist-packages/certbot/main.py”, line 626, in obtain_cert
action, _ = _auth_from_available(le_client, config, domains, certname, lineage)
File “/usr/lib/python2.7/dist-packages/certbot/main.py”, line 107, in _auth_from_available
lineage = le_client.obtain_and_enroll_certificate(domains, certname)
File “/usr/lib/python2.7/dist-packages/certbot/client.py”, line 291, in obtain_and_enroll_certificate
certr, chain, key, _ = self.obtain_certificate(domains)
File “/usr/lib/python2.7/dist-packages/certbot/client.py”, line 262, in obtain_certificate
self.config.allow_subset_of_names)
File “/usr/lib/python2.7/dist-packages/certbot/auth_handler.py”, line 77, in get_authorizations
self._respond(resp, best_effort)
File “/usr/lib/python2.7/dist-packages/certbot/auth_handler.py”, line 134, in _respond
self._poll_challenges(chall_update, best_effort)
File “/usr/lib/python2.7/dist-packages/certbot/auth_handler.py”, line 198, in _poll_challenges
raise errors.FailedChallenges(all_failed_achalls)
FailedChallenges: Failed authorization procedure. feros.fza.hs-kempten.de (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://feros.fza.hs-kempten.de/.well-known/acme-challenge/_XJccXCJnkgUs824FGYZMYImXbaZUbh02v5NkF2dolA: Timeout

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: feros.fza.hs-kempten.de
   Type:   connection
   Detail: Fetching
   http://feros.fza.hs-kempten.de/.well-known/acme-challenge/_XJccXCJnkgUs824FGYZMYImXbaZUbh02v5NkF2dolA:
   Timeout

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A 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):
Server version: Apache/2.4.10 (Debian)
Server built: Nov 28 2015 14:05:48

The operating system my web server runs on is (include version):
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL=“https://bugs.debian.org/

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

Tailing the log of apache parallel to execute the above command to issue a certificate shows
52.29.173.72 - - [21/Nov/2017:14:41:04 +0100] "GET /.well-known/acme-challenge/_XJccXCJnkgUs824FGYZMYImXbaZUbh02v5NkF2dolA HTTP/1.1" 200 310 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
Which IMHO cleary states that the Let’s encrpypt server is actually able to request and get the challenge. I’m completely out of ideas.

Furthermore I put a file test in .well-known/acme-challenge which gets displayed when accessing in a browser through
http://feros.fza.hs-kempten.de/.well-known/acme-challenge/test

Any help is appreciated,
thanks in advance

How often did you try? Did you retry at least once?

About six to eight times

Not necessarily (at least while you're using the staging server) - see Validating challenges from multiple network vantage points

Is it possible that your server or firewall is blocking connections from certain IP addresses or ranges?

@jmorahan thanks for pointing out that staging tries to validate from different vantage points. The firewall indeed blocked access by regions so we removed the rules and it worked.

[edit]
Alas, it only worked with staging, the production server still timeouts. Interestingly now I don’t get any request logged by apache but when issueing a stage certificate it is properly validated.

certbot certonly --staging --webroot -w /var/www/feros -d feros.fza.hs-kempten.de
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Starting new HTTPS connection (1): acme-staging.api.letsencrypt.org
Cert not yet due for renewal

You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/feros.fza.hs-kempten.de.conf)

What would you like to do?
-------------------------------------------------------------------------------
1: Keep the existing certificate for now
2: Renew & replace the cert (limit ~5 per 7 days)
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for feros.fza.hs-kempten.de
Using the webroot path /var/www/feros for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Unable to clean up challenge directory /var/www/feros/.well-known/acme-challenge
Generating key (2048 bits): /etc/letsencrypt/keys/0001_key-certbot.pem
Creating CSR: /etc/letsencrypt/csr/0001_csr-certbot.pem

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at
   /etc/letsencrypt/live/feros.fza.hs-kempten.de/fullchain.pem. Your
   cert will expire on 2018-02-20. To obtain a new or tweaked version
   of this certificate in the future, simply run certbot again. To
   non-interactively renew *all* of your certificates, run "certbot
   renew"
 certbot certonly --webroot -w /var/www/feros -d feros.fza.hs-kempten.de
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Cert not yet due for renewal

You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/feros.fza.hs-kempten.de.conf)

What would you like to do?
-------------------------------------------------------------------------------
1: Keep the existing certificate for now
2: Renew & replace the cert (limit ~5 per 7 days)
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for feros.fza.hs-kempten.de
Using the webroot path /var/www/feros for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Unable to clean up challenge directory /var/www/feros/.well-known/acme-challenge
Failed authorization procedure. feros.fza.hs-kempten.de (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://feros.fza.hs-kempten.de/.well-known/acme-challenge/4e8NzRs5reaVzAjylA0lQzTBGBQV1Kl0QF6sEwJ13hc: Timeout

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: feros.fza.hs-kempten.de
   Type:   connection
   Detail: Fetching
   http://feros.fza.hs-kempten.de/.well-known/acme-challenge/4e8NzRs5reaVzAjylA0lQzTBGBQV1Kl0QF6sEwJ13hc:
   Timeout

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A 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.

Any ideas?

1 Like

I can only make the obvious suggestion that perhaps the production server is trying to validate from yet another different vantage point? Are you sure you’re not still blocking something?

Yeah, an we have a further problem, that our firewall reorders its rules on a nightly basis so the geo-ip based blockes are enabled the next day. We need to further investigate in this issue. For know I’ll accept your solution @jmorahan, many thanks

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