PyDocs

Nav

Networking and Interprocess Communication

SSLSocket.getpeercert

ssl

method of SSLSocket (source) not WASI
  • SSLSocket.getpeercert(binary_form=False)
Returns a formatted version of the data in the certificate provided
by the other end of the SSL channel.

Return None if no certificate was provided, {} if a certificate was
provided, but not validated.
Changed in 3.2, 3.4, 3.9
  • 3.2: The returned dictionary includes additional items such as issuer and notBefore.
  • 3.4: ValueError is raised when the handshake isn’t done. The returned dictionary includes additional X509v3 extension items such as crlDistributionPoints, caIssuers and OCSP URIs.
  • 3.9: IPv6 address strings no longer have a trailing new line.
1 Example
>>> cert = conn.getpeercert()
from the Python docs
See Also
No see-alsos for ssl/SSLSocket.getpeercert
0 Notes
No notes for SSLSocket.getpeercert