Certbot not working properly with DNS-01
I was previously using the TLS-SNI-01 authentication method for my mail server — certbot 0.28.0 —, but due to the deprecation I decided to switch to the DNS-01 method, since I have a running bind9 installation on my server, with Ubuntu 16.04.5 LTS.
To do that I installed the certbot-dns-rfc2136
package, created a HMAC-SHA512 key, updated bind9 for the _acme-challenge.
, and finally created the credentials file for the rfc2136 plugin:
dns_rfc2136_server = 78.47.161.24
dns_rfc2136_name = <NAME>
dns_rfc2136_secret = <SECRET_KEY>
dns_rfc2136_algorithm = HMAC-SHA512
With everthing configured I tested the configuration with a dry run: certbot certonly --dry-run --dns-rfc2136 --dns-rfc2136-credentials /root/certbot-rfc2136.ini --dns-rfc2136-propagation-seconds 5 -d mail.skydubh.com
:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator dns-rfc2136, Installer None
Obtaining a new certificate
Performing the following challenges:
dns-01 challenge for mail.skydubh.com
Waiting 5 seconds for DNS changes to propagate
Waiting for verification...
Cleaning up challenges
IMPORTANT NOTES:
- The dry run was successful.
At this point I generated the certificate without the --dry-run
and the problems started. Certbot creates an empty configuration file:
# ls -al /etc/letsencrypt/renewal
-rw-r--r-- 1 root root 0 Jan 27 16:49 mail.skydubh.com.conf
The renew
fails due to the empty configuration file:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/certbot/renewal.py", line 64, in _reconstitute
renewal_candidate = storage.RenewableCert(full_path, config)
File "/usr/lib/python3/dist-packages/certbot/storage.py", line 441, in __init__
"file reference".format(self.configfile))
certbot.errors.CertStorageError: renewal config file {} is missing a required file reference
Renewal configuration file /etc/letsencrypt/renewal/mail.skydubh.com.conf is broken. Skipping.
Manually passing the --dns-rfc2136-*
parameters doesn’t help either for the same reason.
I started considering using certbot-auto
to have an up to date version that wasn’t provided through packages, but I’ve been unable to make it use python3 (I’ve tried exporting USE_PYTHON_3=1
to no avail), and given that the only package available is python3-certbot-dns-rfc2136
, certbot-auto
complains about not finding the dns-rfc2136 plugin: The requested dns-rfc2136 plugin does not appear to be installed
.
I’m out of ideas, how do I get out of this alive?