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)
| 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 |
no outgoing calls