ctrlaltcoop / certbot-dns-hetzner

Certbot plugin enabling dns-01 challenge on the Hetzner DNS API
Other
155 stars 24 forks source link

Cleanup only removes the 1st TXT dns entry if more than 1 domain is given #2

Closed robertoschwald closed 4 years ago

robertoschwald commented 4 years ago

If more than one domain name is given on issue, only the first entry is removed on cleanup.

e.g.

sudo certbot --installer apache \
  --authenticator certbot-dns-hetzner:dns-hetzner \
  --certbot-dns-hetzner:dns-hetzner-credentials /etc/sysconfig/mycred.ini \
  -d host1.xx.yyy \
  -d host2.xx.yyy

This generates 2 challenge TXT dns entries, but at the end leads to:

Waiting for verification...
Cleaning up challenges
Starting new HTTPS connection (1): dns.hetzner.com
Encountered exception during recovery:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/certbot/_internal/error_handler.py", line 125, in _call_registered
    self.funcs[-1]()
  File "/usr/lib/python2.7/site-packages/certbot/_internal/auth_handler.py", line 243, in _cleanup_challenges
    self.auth.cleanup(achalls)
  File "/usr/lib/python2.7/site-packages/certbot/plugins/dns_common.py", line 76, in cleanup
    self._cleanup(domain, validation_domain_name, validation)
  File "/usr/lib/python2.7/site-packages/certbot_dns_hetzner/dns_hetzner.py", line 71, in _cleanup
    self._get_hetzner_client().delete_record(record_id=self.record_id)
  File "/usr/lib/python2.7/site-packages/certbot_dns_hetzner/hetzner_client.py", line 106, in delete_record
    raise _MalformedResponseException('Status code not 200')
_MalformedResponseException: Received an unexpected response from Hetzner API:
Status code not 200
Created an SSL vhost at /etc/httpd/conf.d/vhost-le-ssl.conf

Then I need to cleanup the challenge manually from the DNS table.

OS is CentOS7.

matze19999 commented 4 years ago

Can confirm on Debian for Docker

l0rn commented 4 years ago

Will investigate this

l0rn commented 4 years ago

I had a bad fight with github action filters, but you should have a proper version with 1.0.3 now containing this fix

robertoschwald commented 4 years ago

1.0.2 with the fix was already available to pip ;-)

l0rn commented 4 years ago

Yeah that was a GitHub action mess up ;) from now versioning should continue in an orderly fashion