From de93ea744ad16f5d8afe5f62dd5a564983c96611 Mon Sep 17 00:00:00 2001 From: Eric Li Date: Mon, 23 Oct 2023 20:45:16 -0400 Subject: [PATCH] Print more helpful error message when csc-verification record is missing --- ceod/model/VHostManager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ceod/model/VHostManager.py b/ceod/model/VHostManager.py index ddd8e43..0710236 100644 --- a/ceod/model/VHostManager.py +++ b/ceod/model/VHostManager.py @@ -111,9 +111,11 @@ class VHostManager: rootname = tldextract.extract(domain).registered_domain try: records = dns.resolver.resolve(rootname, "TXT").rrset + records_text = [] for x in records: + records_text.append(x.to_text()) if record in x.to_text(): - print(f"found correct`csc-verification` record at {rootname}") + print(f"found correct `csc-verification` record at {rootname}") return True except dns.resolver.NoAnswer as e: @@ -124,6 +126,8 @@ class VHostManager: return False print(f"cannot find a `csc-verification` record at {rootname}") + print(f"EXPECTED: \"{record}\"") + print(f"FOUND: \n" + '\n'.join(records_text)) return False # deny by default