Python tricks
Posted on 2018-10-03 in Trucs et astuces • Tagged with Python
Inspect TLS certificates with requests
Use the snippet below to capture and inspect the certificates of a distant site and its chain with requests.
import requests HTTPResponse = requests.packages.urllib3.response.HTTPResponse orig_HTTPResponse__init__ = HTTPResponse.__init__ def new_HTTPResponse__init__(self, *args, **kwargs): orig_HTTPResponse__init__(self, *args, **kwargs …
Continue reading