Print more helpful error message when csc-verification record is missing
This commit is contained in:
parent
2aca16688d
commit
de93ea744a
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue