Fixing the truth in Changelog SSL.py and test_ssl.py
diff --git a/ChangeLog b/ChangeLog
index cd84be7..b5b3922 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,8 @@
2015-05-27 Jim Shaver <dcypherd@gmail.com>
* OpenSSL/SSL.py, : Add ``get_protocol_version()`` and
- ``get_protocol_version_name()`` to Connection
- Based on work from Rich Moore
+ ``get_protocol_version_name()`` to ``Connection``.
+ Based on work from Rich Moore.
2015-05-02 Jim Shaver <dcypherd@gmail.com>
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`.
diff --git a/doc/api/ssl.rst b/doc/api/ssl.rst
index 38f0d33..3315580 100644
--- a/doc/api/ssl.rst
+++ b/doc/api/ssl.rst
@@ -601,9 +601,8 @@
.. py:method:: Connection.get_protocol_version()
Retrieve the version of the SSL or TLS protocol used by the Connection.
- For example, it will return ``0x303`` for connections made over TLS
- version 1.2, or ``Unknown`` for connections that were not successfully
- established.
+ For example, it will return ``0x769`` for connections made over TLS
+ version 1.
.. py:method:: Connection.get_protocol_version_name()