In CPython 3.10 there were private APIs `SSLObject.get_verified_chain()` and `_ssl.Certificate.public_bytes(_ssl.ENCODING_DER)` methods added. Ref: https://github.com/python/cpython/pull/25467 ```python import hashlib import _ssl fingerprints = [hashlib.sha256(cert.public_bytes(_ssl.ENCODING_DER)).hexdigest() for cert in sock._sslobj.get_verified_chain()] ```