Notes to Self

Alex Sokolsky's Notes on Computers and Programming

View on GitHub

Server and Client-side Certificates for Python Programmer

HTTP Client to HTTP Server

This is well understood.

HTTPS Client to HTTPS Server

HTTPS Server certificate includes:

More reading:

Python code to establish HTTS connection with a server, which relies on a custom CA:

ses = requests.Session()
ses.verify = '/path/to/CAs'
r = ses.get( 'https://server', verify=False )

More on that: https://requests.readthedocs.io/en/master/user/advanced/#ssl-cert-verification

HTTPS Client with a Certificate to HTTPS Server

Need to associate a client certificate AND a private key with a session:

ses = requests.Session()
ses.verify = '/path/to/CAs'
ses.cert = '/path/client.cert'
r = ses.get( 'https://server', verify=False )