'Perform the TLS handshake between two :py:class:`Connection` instances
connected to each other via memory BIOs.'

def _handshakeInMemory(self, client_conn, server_conn):

    client_conn.set_connect_state()
    server_conn.set_accept_state()
    for conn in [client_conn, server_conn]:
        try:
            conn.do_handshake()
        except WantReadError:
            pass
    self._interactInMemory(client_conn, server_conn)
