dnsrobocert
dnsrobocert copied to clipboard
debug request and response
Hi, I've been troubleshooting a namecheap issue for the past two days, and it would help immensely to have a debug option which includes the api requests and responses.
This is an enhancement.
So far I have narrowed the issue to too many values to unpack as my domain is a .co.uk (namecheap.py line 403) I tried delegated domain but it didn't work either.
Troubleshooting continues :-)
I have got this working, I think by modifying /usr/local/lib/python3.9/site-packages/lexicon/providers/namecheap.py ( https://github.com/AnalogJ/lexicon/blob/master/lexicon/providers/namecheap.py)
I added:
import tldextract
and then replacing all the occurrences of:
sld, tld = domain.split(".")
with:
extracted = tldextract.extract(domain)
sld = extracted.domain
tld = extracted.suffix
I would still like a debug flag though :-)
I added
print("--- Request ---")
print(response.url)
print(extra_payload)
print("--- Response ---")
print(response.text)
prior to
if not 200 <= response.status_code <= 299:
raise _ApiError("1", "Did not receive 200 (Ok) response")