Commit 1356b245 authored by Adrien Dorsaz's avatar Adrien Dorsaz
Browse files

Merge branch 'wip/fix_dnshost_with_ip' into 'master'

DNS: fix search of dns host IP address configuration give us already an IP address

See merge request !3
parents fb2ba6ff afaf88a2
Pipeline #41 passed with stage
in 4 minutes and 1 second
......@@ -54,11 +54,16 @@ def get_crt(config, log=LOGGER):
# create DNS keyring and resolver
keyring = dns.tsigkeyring.from_text({config["TSIGKeyring"]["KeyName"]: config["TSIGKeyring"]["KeyValue"]})
nameserver = []
nameserver = [ipv4_rrset.to_text() for ipv4_rrset in dns.resolver.query(config["DNS"]["Host"], rdtype="A")]
except dns.exception.DNSException as e:"DNS IPv4 record not found for configured dns host.")
nameserver = nameserver + [ipv6_rrset.to_text() for ipv6_rrset in dns.resolver.query(config["DNS"]["Host"], rdtype="AAAA")]
except dns.exception.DNSException as e:"DNS IPv4 and IPv6 records not found for configured dns host. Try to keep original name.")
if not nameserver:
nameserver = [config["DNS"]["Host"]]
......@@ -154,7 +159,7 @@ def get_crt(config, log=LOGGER):
if number_check_fail > 10:
raise ValueError("Error checking challenge, value not found: {0}".format(keydigest64))
if challenge_verified is False:
number_check_fail = number_check_fail + 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment