From ca79408f1e1e1b592339dd24dc05677ab3aa44a1 Mon Sep 17 00:00:00 2001 From: Andreas Hildebrandt Date: Fri, 17 Sep 2021 09:17:07 +0200 Subject: [PATCH] Allow requesting certificates for subdomains. --- certbot_dns_ionos/dns_ionos.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/certbot_dns_ionos/dns_ionos.py b/certbot_dns_ionos/dns_ionos.py index a486c8b..636bd86 100644 --- a/certbot_dns_ionos/dns_ionos.py +++ b/certbot_dns_ionos/dns_ionos.py @@ -97,6 +97,12 @@ class _ionosClient(object): # get the zone id if zone['name'] == domain: return zone['id'], zone['name'] + # if the domain does not exactly match one of the zones, check if it + # is a subdomain + for zone in zones: + # get the zone id + if domain.endswith(zone['name']): + return zone['id'], zone['name'] return None, None def _api_request(self, type, action, data = None):