Certificate renewal problem (Solved)

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:
I ran this command:
certbot renew -q --pre-hook “service apache2 stop” --post-hook "service apache2 start"
It produced this output:
Here is only the last part of the logfile:

2017-12-07 07:35:08,210:DEBUG:certbot.reporter:Reporting to user: The following errors were reported by the server:

Domain: glinithai.ddns.net
Type: connection
Detail: Timeout

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.
2017-12-07 07:35:08,211:INFO:certbot.auth_handler:Cleaning up challenges
2017-12-07 07:35:08,365:WARNING:certbot.renewal:Attempting to renew cert (glinithai.ddns.net) from /etc/letsencrypt/renewal/glinithai.ddns.net.conf produced an unexpected error: Failed authorization procedure. glinithai.ddns.net (tls-sni-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Timeout. Skipping.
2017-12-07 07:35:08,365:DEBUG:certbot.renewal:Traceback was:
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/certbot/renewal.py”, line 425, in handle_renewal_request
main.renew_cert(lineage_config, plugins, renewal_candidate)
File “/usr/lib/python2.7/dist-packages/certbot/main.py”, line 743, in renew_cert
_get_and_save_cert(le_client, config, lineage=lineage)
File “/usr/lib/python2.7/dist-packages/certbot/main.py”, line 80, in _get_and_save_cert
renewal.renew_cert(config, domains, le_client, lineage)
File “/usr/lib/python2.7/dist-packages/certbot/renewal.py”, line 297, in renew_cert
new_certr, new_chain, new_key, _ = le_client.obtain_certificate(domains)
File “/usr/lib/python2.7/dist-packages/certbot/client.py”, line 318, in obtain_certificate
File “/usr/lib/python2.7/dist-packages/certbot/auth_handler.py”, line 81, in get_authorizations
self._respond(resp, best_effort)
File “/usr/lib/python2.7/dist-packages/certbot/auth_handler.py”, line 138, in _respond
self._poll_challenges(chall_update, best_effort)
File “/usr/lib/python2.7/dist-packages/certbot/auth_handler.py”, line 202, in _poll_challenges
raise errors.FailedChallenges(all_failed_achalls)
FailedChallenges: Failed authorization procedure. glinithai.ddns.net (tls-sni-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Timeout

2017-12-07 07:35:08,366:ERROR:certbot.renewal:All renewal attempts failed. The following certs could not be renewed:
2017-12-07 07:35:08,366:ERROR:certbot.renewal: /etc/letsencrypt/live/glinithai.ddns.net/fullchain.pem (failure)
2017-12-07 07:35:08,366:INFO:certbot.hooks:Running post-hook command: service apache2 start
2017-12-07 07:35:09,537:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
File “/usr/bin/certbot”, line 11, in
load_entry_point(‘certbot==0.19.0’, ‘console_scripts’, ‘certbot’)()
File “/usr/lib/python2.7/dist-packages/certbot/main.py”, line 861, in main
return config.func(config, plugins)
File “/usr/lib/python2.7/dist-packages/certbot/main.py”, line 797, in renew
File “/usr/lib/python2.7/dist-packages/certbot/renewal.py”, line 443, in handle_renewal_request
len(renew_failures), len(parse_failures)))
Error: 1 renew failure(s), 0 parse failure(s)

My web server is (include version):
Apache Version Apache/2.4.18 (Ubuntu)
Apache API Version 20120211
The operating system my web server runs on is (include version):
Ubuntu 16.04
Linux my-nas 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
My hosting provider, if applicable, is:
Private Server ay home
I can login to a root shell on my machine (yes or no, or I don’t know):
I’m using a control panel to manage my site (no, or provide the name and version of the control panel):

I set up this webserver in April this year and decided to use lets encrypt for certificates, everything worked fine, until some days ago the automatic renewal don’t work anymore. The certificate is still valid until January 3rd. But should be renewed in the next days.
The site is accessable from outside, I don’t know why this happens.
One thing I realized, I’m living in Thailand and the standard port 443 is not accessible from outside Thailand.
So, I configured a second port to access https, but I can’t imagine this is the reason for my problem.
Thanks in advance for all help

The Apache plugin uses the tls-sni-01 authentication by default, which always connects over port 443. Do you know why your server can’t be accessed over that port from outside Thailand?

If that is indeed the case, you may need to use the http-01 challenge, which works over port 80. Is that accessible?

I don’t know why yhe port is not accessible, I asked the question to my provider, but got no answer until now. But than, it seems it was not always like that, because at the beginning when I set up the server there was no problem. I saw by chance that it is not accessible because I was remote connected to my sisters PC in Europe. Port 80 should be accessible, but it is redirected automatically, I can try to change the redirection. How must I configure the system to use http-01?

It does seem strange to me as well, from multiple perspectives. If port 80 is accessible, you can chance the --apache flag to -i apache -a webroot. This will still use Apache to install the certificate, but the webroot plugin fo the challenges. You will also need to specify the directory on your system which serves as your web server’s root. That is, the directory in which you’d place a file (say, named example.html) you want to be able to load from glinithai.ddns.net/example.html. You would specify this with a -w flag. If this directory was /var/www/html, the flags would be -i apache -a webroot -w /var/www/html

Let us know how this goes!


Thanks a lot Jared, this works fine for me. I started this once manually and it changed automatically the configfile, so that I even don’t have to change the crontab command.
I sent a request again to my provider, because I still want to have an explanation why port 443 is blocked.

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