I am using Python 3. I am using a SSLContext
from the ssl
library.
I would like to know how to request and get the remote peer certificate (as with SSLSocket.getpeercert()
) but in the CERT_NONE
mode. Currently, I get an empty dict (which is expected as per the documentation). So, can I do that without digging into private stuff?
N.B.
I am not trying to reimplement crypto. Actually, I don't need any crypto, however I need the context (and a socket) and the remote certificate (again, for information purpose, not to authenticate or actually encrypt anything).