MCPcopy Index your code
hub / github.com/python/cpython / get_verified_chain

Method get_verified_chain

Lib/ssl.py:888–900  ·  view source on GitHub ↗

Returns verified certificate chain provided by the other end of the SSL channel as a list of DER-encoded bytes. If certificate verification was disabled method acts the same as ``SSLSocket.get_unverified_chain``.

(self)

Source from the content-addressed store, hash-verified

886 return self._sslobj.getpeercert(binary_form)
887
888 def get_verified_chain(self):
889 """Returns verified certificate chain provided by the other
890 end of the SSL channel as a list of DER-encoded bytes.
891
892 If certificate verification was disabled method acts the same as
893 ``SSLSocket.get_unverified_chain``.
894 """
895 chain = self._sslobj.get_verified_chain()
896
897 if chain is None:
898 return []
899
900 return [cert.public_bytes(_ssl.ENCODING_DER) for cert in chain]
901
902 def get_unverified_chain(self):
903 """Returns raw certificate chain provided by the other

Callers 4

get_verified_chainMethod · 0.45
runMethod · 0.45

Calls

no outgoing calls

Tested by 3

runMethod · 0.36