mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
expose the client's cipher suites from the handshake (closes #23186)
This commit is contained in:
parent
e5db863c22
commit
4cb17812d9
5 changed files with 94 additions and 21 deletions
10
Lib/ssl.py
10
Lib/ssl.py
|
@ -572,6 +572,10 @@ class SSLObject:
|
|||
ssl_version, secret_bits)``."""
|
||||
return self._sslobj.cipher()
|
||||
|
||||
def shared_ciphers(self):
|
||||
"""Return the ciphers shared by the client during the handshake."""
|
||||
return self._sslobj.shared_ciphers()
|
||||
|
||||
def compression(self):
|
||||
"""Return the current compression algorithm in use, or ``None`` if
|
||||
compression was not negotiated or not supported by one of the peers."""
|
||||
|
@ -784,6 +788,12 @@ class SSLSocket(socket):
|
|||
else:
|
||||
return self._sslobj.cipher()
|
||||
|
||||
def shared_ciphers(self):
|
||||
self._checkClosed()
|
||||
if not self._sslobj:
|
||||
return None
|
||||
return self._sslobj.shared_ciphers()
|
||||
|
||||
def compression(self):
|
||||
self._checkClosed()
|
||||
if not self._sslobj:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue