-
Notifications
You must be signed in to change notification settings - Fork 422
Closed
Milestone
Description
0.7 it definitely isn’t anymore:
====================================================================================================================================================== FAILURES =======================================================================================================================================================
______________________________________________________________________________________________________________________________________ ConnectionTests.test_get_protocol_version ______________________________________________________________________________________________________________________________________
self = <tests.test_ssl.ConnectionTests testMethod=test_get_protocol_version>
def test_get_protocol_version(self):
"""
:py:obj:`Connection.get_protocol_version()` returns an integer
giving the protocol version of the current connection.
"""
server, client = self._loopback()
> client_protocol_version = client.get_protocol_version()
tests/test_ssl.py:2750:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <OpenSSL.SSL.Connection object at 0x1101d0850>
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)
E AttributeError: 'FFILibrary' object has no attribute 'SSL_version'
src/OpenSSL/SSL.py:1858: AttributeError
___________________________________________________________________________________________________________________________________ ConnectionTests.test_get_protocol_version_name ____________________________________________________________________________________________________________________________________
self = <tests.test_ssl.ConnectionTests testMethod=test_get_protocol_version_name>
def test_get_protocol_version_name(self):
"""
:py:obj:`Connection.get_protocol_version_name()` returns a string
giving the protocol version of the current connection.
"""
server, client = self._loopback()
> client_protocol_version_name = client.get_protocol_version_name()
tests/test_ssl.py:2734:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <OpenSSL.SSL.Connection object at 0x11052b410>
def get_protocol_version_name(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 ``TLSv1.2``or ``Unknown``
for connections that were not successfully established.
:rtype: :py:class:`unicode`
"""
> version = _ffi.string(_lib.SSL_get_version(self._ssl))
E AttributeError: 'FFILibrary' object has no attribute 'SSL_get_version'
src/OpenSSL/SSL.py:1847: AttributeError
______________________________________________________________________________________________________________________________________________ ConnectionTests.test_peek ______________________________________________________________________________________________________________________________________________
self = <tests.test_ssl.ConnectionTests testMethod=test_peek>
def test_peek(self):
"""
:py:obj:`Connection.recv` peeks into the connection if
:py:obj:`socket.MSG_PEEK` is passed.
"""
server, client = self._loopback()
server.send(b('xy'))
> self.assertEqual(client.recv(2, MSG_PEEK), b('xy'))
tests/test_ssl.py:2147:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <OpenSSL.SSL.Connection object at 0x110583d50>, bufsiz = 2, flags = 2
def recv(self, bufsiz, flags=None):
"""
Receive data on the connection. NOTE: If you get one of the WantRead,
WantWrite or WantX509Lookup exceptions on this, you have to call the
method again with the SAME buffer.
:param bufsiz: The maximum number of bytes to read
:param flags: (optional) The only supported flag is ``MSG_PEEK``,
all other flags are ignored.
:return: The string read from the Connection
"""
buf = _ffi.new("char[]", bufsiz)
if flags is not None and flags & socket.MSG_PEEK:
> result = _lib.SSL_peek(self._ssl, buf, bufsiz)
E AttributeError: 'FFILibrary' object has no attribute 'SSL_peek'
src/OpenSSL/SSL.py:1299: AttributeError
__________________________________________________________________________________________________________________________________________ ConnectionRecvIntoTests.test_peek __________________________________________________________________________________________________________________________________________
self = <tests.test_ssl.ConnectionRecvIntoTests testMethod=test_peek>
def test_peek(self):
server, client = self._loopback()
server.send(b('xy'))
for _ in range(2):
output_buffer = bytearray(5)
self.assertEqual(
> client.recv_into(output_buffer, flags=MSG_PEEK), 2)
tests/test_ssl.py:2967:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <OpenSSL.SSL.Connection object at 0x11055c290>, buffer = bytearray(b'\x00\x00\x00\x00\x00'), nbytes = 5, flags = 2
def recv_into(self, buffer, nbytes=None, flags=None):
"""
Receive data on the connection and store the data into a buffer rather
than creating a new string.
:param buffer: The buffer to copy into.
:param nbytes: (optional) The maximum number of bytes to read into the
buffer. If not present, defaults to the size of the buffer. If
larger than the size of the buffer, is reduced to the size of the
buffer.
:param flags: (optional) The only supported flag is ``MSG_PEEK``,
all other flags are ignored.
:return: The number of bytes read into the buffer.
"""
if nbytes is None:
nbytes = len(buffer)
else:
nbytes = min(nbytes, len(buffer))
# We need to create a temporary buffer. This is annoying, it would be
# better if we could pass memoryviews straight into the SSL_read call,
# but right now we can't. Revisit this if CFFI gets that ability.
buf = _ffi.new("char[]", nbytes)
if flags is not None and flags & socket.MSG_PEEK:
> result = _lib.SSL_peek(self._ssl, buf, nbytes)
E AttributeError: 'FFILibrary' object has no attribute 'SSL_peek'
src/OpenSSL/SSL.py:1330: AttributeError
=================================================================================================================================== 4 failed, 450 passed, 1 skipped in 3.63 seconds ===================================================================================================================================
Once we find it out, we also have to add a tox env with that version pinned.
Metadata
Metadata
Assignees
Labels
No labels