summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHynek Schlawack <hs@ox.cx>2016-03-13 16:17:53 +0100
committerHynek Schlawack <hs@ox.cx>2016-03-14 14:54:13 +0100
commitea94f2bfd5d2a81e110f863793bdae967a1288f9 (patch)
treeedd88cffd952e12e3aefd5472f0e25ff99356505
parent16c3dc2cad3fc2e0ee4349b1c35c76f6534f2fb1 (diff)
downloadpyopenssl-ea94f2bfd5d2a81e110f863793bdae967a1288f9.tar.gz
Rename state_name to get_state_name
A bit more consistent naming. Rename is possible because the method hasn't been part of a release yet.
-rw-r--r--CHANGELOG.rst2
-rw-r--r--doc/api/ssl.rst5
-rw-r--r--src/OpenSSL/SSL.py5
-rw-r--r--tests/test_ssl.py4
4 files changed, 7 insertions, 9 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 12721d0..d2f8f85 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -49,7 +49,7 @@ Changes:
`#382 <https://github.com/pyca/pyopenssl/pull/382>`_
- Added ``OpenSSL.crypto.dump_crl()`` to dump a certificate revocation list out to a string buffer.
`#368 <https://github.com/pyca/pyopenssl/pull/368>`_
-- Added ``OpenSSL.SSL.Connection.state_string()`` using the OpenSSL binding ``state_string_long``.
+- Added ``OpenSSL.SSL.Connection.get_state_string()`` using the OpenSSL binding ``state_string_long``.
`#358 <https://github.com/pyca/pyopenssl/pull/358>`_
- Added support for the ``socket.MSG_PEEK`` flag to ``OpenSSL.SSL.Connection.recv()`` and ``OpenSSL.SSL.Connection.recv_into()``.
`#294 <https://github.com/pyca/pyopenssl/pull/294>`_
diff --git a/doc/api/ssl.rst b/doc/api/ssl.rst
index e3fe8c9..d144cfd 100644
--- a/doc/api/ssl.rst
+++ b/doc/api/ssl.rst
@@ -770,10 +770,7 @@ Connection objects have the following methods:
BIO.
-.. py:method:: Connection.state_string()
-
- Retrieve a verbose string detailing the state of the Connection.
-
+.. automethod:: Connection.get_state_string
.. py:method:: Connection.client_random()
diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py
index 8ae7449..160cfd8 100644
--- a/src/OpenSSL/SSL.py
+++ b/src/OpenSSL/SSL.py
@@ -1590,11 +1590,12 @@ class Connection(object):
_lib.SSL_set_shutdown(self._ssl, state)
- def state_string(self):
+ def get_state_string(self):
"""
- Get a verbose state description
+ Retrieve a verbose string detailing the state of the Connection.
:return: A string representing the state
+ :rtype: bytes
"""
return _ffi.string(_lib.SSL_state_string_long(self._ssl))
diff --git a/tests/test_ssl.py b/tests/test_ssl.py
index da313f7..8040c97 100644
--- a/tests/test_ssl.py
+++ b/tests/test_ssl.py
@@ -2353,8 +2353,8 @@ class ConnectionTests(TestCase, _LoopbackMixin):
server = self._loopbackServerFactory(server)
client = self._loopbackClientFactory(client)
- assert b"before/accept initialization" == server.state_string()
- assert b"before/connect initialization" == client.state_string()
+ assert b"before/accept initialization" == server.get_state_string()
+ assert b"before/connect initialization" == client.get_state_string()
def test_app_data_wrong_args(self):
"""