From 7ce01d3ded529ea6a818a9942961c0f53e2c29cf Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Tue, 10 Dec 2019 00:24:01 +0100 Subject: [PATCH] Fix acme domain IP validation with cname --- wo/core/acme.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/wo/core/acme.py b/wo/core/acme.py index 330f778..75c4bf9 100644 --- a/wo/core/acme.py +++ b/wo/core/acme.py @@ -188,20 +188,8 @@ class WOAcme: """Check if a list of domains point to the server IP""" server_ip = requests.get('https://v4.wordops.eu/').text for domain in acme_domains: - url = ( - "https://cloudflare-dns.com/dns-query?name={0}&type=A" - .format(domain)) - headers = { - 'accept': 'application/dns-json' - } - try: - response = requests.get(url, headers=headers).json() - domain_ip = response["Answer"][0]['data'] - except requests.RequestException: - Log.error( - self, 'Resolving domain IP failed.\n' - 'The domain {0} do not exist or a DNS record is missing' - .format(domain)) + domain_ip = requests.get('http://v4.wordops.eu/dns/{0}/' + .format(domain)).text if(not domain_ip == server_ip): Log.warn( self, "{0}".format(domain) +