'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) Included for compatibility with the socket
API, the value is ignored.
:return: The number of bytes read into the buffer.'

def recv_into(self, buffer, nbytes=None, flags=None):

    if (nbytes is None):
        nbytes = len(buffer)
    else:
        nbytes = min(nbytes, len(buffer))
    buf = _ffi.new('char[]', nbytes)
    result = _lib.SSL_read(self._ssl, buf, nbytes)
    self._raise_ssl_error(self._ssl, result)
    try:
        buffer[:result] = memoryview(_ffi.buffer(buf, result))
    except NameError:
        buffer[:result] = _ffi.buffer(buf, result)
    return result
