Fixing the truth in Changelog SSL.py and test_ssl.py
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py
index af1931f..ec03241 100644
--- a/OpenSSL/SSL.py
+++ b/OpenSSL/SSL.py
@@ -1889,12 +1889,24 @@
:returns: The TLS version of the current connection, for example
the value for TLS 1.2 would be ``b'TLSv1.2'``.
- :rtype: :py:class:`unicode`
+ :rtype: :py:class:`bytes`
"""
version = _ffi.string(_lib.SSL_get_version(self._ssl))
return version
+ def get_protocol_version(self):
+ """
+ Obtain the protocol version of the current connection.
+
+ :returns: The TLS version of the current connection, for example
+ the value for TLS 1 would be 0x769.
+ :rtype: :py:class:`int`
+ """
+ version = _lib.SSL_version(self._ssl)
+ return version
+
+
@_requires_npn
def get_next_proto_negotiated(self):
"""
@@ -1950,17 +1962,6 @@
return _ffi.buffer(data[0], data_len[0])[:]
- def get_protocol_version(self):
- """
- Obtain the protocol version of the current connection.
-
- :returns: The TLS version of the current connection, for example
- the value for TLS 1.2 would be 0x303.
- :rtype: :py:class:`int`
- """
- version = _lib.SSL_version(self._ssl)
- return version
-
ConnectionType = Connection
diff --git a/OpenSSL/test/test_ssl.py b/OpenSSL/test/test_ssl.py
index 01a76c1..91f115c 100644
--- a/OpenSSL/test/test_ssl.py
+++ b/OpenSSL/test/test_ssl.py
@@ -2775,6 +2775,7 @@
self.assertEqual(server_protocol_version, client_protocol_version)
+
class ConnectionGetCipherListTests(TestCase):
"""
Tests for :py:obj:`Connection.get_cipher_list`.