summaryrefslogtreecommitdiffstats
path: root/Doc/library/ssl.rst
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-09-04 19:00:10 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2014-09-04 19:00:10 (GMT)
commit47e40429fbebb7c0751c5cb20d666089b05710c6 (patch)
treeb20eadff0e6aa3f3091e5931955d3e51ffbe0a4a /Doc/library/ssl.rst
parent60a64d6812e5d3c3bf4291081e3db9dc6acf996c (diff)
downloadcpython-47e40429fbebb7c0751c5cb20d666089b05710c6.zip
cpython-47e40429fbebb7c0751c5cb20d666089b05710c6.tar.gz
cpython-47e40429fbebb7c0751c5cb20d666089b05710c6.tar.bz2
Issue #20421: Add a .version() method to SSL sockets exposing the actual protocol version in use.
Diffstat (limited to 'Doc/library/ssl.rst')
-rw-r--r--Doc/library/ssl.rst18
1 files changed, 14 insertions, 4 deletions
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index d5328c3..a0dffe0 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -910,10 +910,10 @@ SSL sockets also have the following additional methods and attributes:
.. method:: SSLSocket.selected_npn_protocol()
- Returns the protocol that was selected during the TLS/SSL handshake. If
- :meth:`SSLContext.set_npn_protocols` was not called, or if the other party
- does not support NPN, or if the handshake has not yet happened, this will
- return ``None``.
+ Returns the higher-level protocol that was selected during the TLS/SSL
+ handshake. If :meth:`SSLContext.set_npn_protocols` was not called, or
+ if the other party does not support NPN, or if the handshake has not yet
+ happened, this will return ``None``.
.. versionadded:: 3.3
@@ -925,6 +925,16 @@ SSL sockets also have the following additional methods and attributes:
returned socket should always be used for further communication with the
other side of the connection, rather than the original socket.
+.. method:: SSLSocket.version()
+
+ Return the actual SSL protocol version negotiated by the connection
+ as a string, or ``None`` is no secure connection is established.
+ As of this writing, possible return values include ``"SSLv2"``,
+ ``"SSLv3"``, ``"TLSv1"``, ``"TLSv1.1"`` and ``"TLSv1.2"``.
+ Recent OpenSSL versions may define more return values.
+
+ .. versionadded:: 3.5
+
.. attribute:: SSLSocket.context
The :class:`SSLContext` object this SSL socket is tied to. If the SSL