Skip to content

Instantly share code, notes, and snippets.

@aiguofer
aiguofer / encrypeted_cert_session.py
Created February 13, 2017 15:14
Creating a Python requests session using a passphrase protected Client side Cert
import ssl
from requests.adapters import HTTPAdapter
CFG_FILE = '<path_to_cfg>'
secure_hosts = [
'https://<host>'
]
class SSLAdapter(HTTPAdapter):
def __init__(self, certfile, keyfile, password=None, *args, **kwargs):