mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Issue #20421: Add a .version() method to SSL sockets exposing the actual protocol version in use.
This commit is contained in:
parent
60a64d6812
commit
47e40429fb
5 changed files with 86 additions and 24 deletions
|
@ -861,6 +861,15 @@ class SSLSocket(socket):
|
|||
return None
|
||||
return self._sslobj.tls_unique_cb()
|
||||
|
||||
def version(self):
|
||||
"""
|
||||
Return a string identifying the protocol version used by the
|
||||
current SSL channel, or None if there is no established channel.
|
||||
"""
|
||||
if self._sslobj is None:
|
||||
return None
|
||||
return self._sslobj.version()
|
||||
|
||||
|
||||
def wrap_socket(sock, keyfile=None, certfile=None,
|
||||
server_side=False, cert_reqs=CERT_NONE,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue