Allow broken certificate for a specific host with Python's requests

After a bit of trial error, this is how you can allow requests to connect to a specific host, despite a broken certificate: import requests import requests.adapters import ssl import urllib3 from urllib3.util import create_urllib3_context class AllowBrokenSSLContextHTTPAdapter(requests.adapters.HTTPAdapter): def __init__(self, **kwargs): ssl_context = create_urllib3_context()…