I can get the standard certificate information for an SSL connection in Python 3.3 via the getpeercert() method on the SSL socket. However, it doesn\'t seem to provide the c
I'm not sure, but I think that part of the OpenSSL API just isn't available in Python's ssl-module.
It seems that the function SSL_get_peer_cert_chain
is used to access the certificate chain in OpenSSL. See, for example, the section of openssl s_client that prints the output you included. On the other hand, grepping the source of Python's ssl-module for SSL_get_peer_cert_chain
yields no matches.
M2Crypto and pyOpenSSL both seem to include a get_peer_cert_chain
function, if you're willing to look at other (and non-stdlib) libraries. I can't vouch for them personally, though, since I haven't used them much.