def handshake_in_memory(client_conn, server_conn):
    '\n    Perform the TLS handshake between two `Connection` instances connected to\n    each other via memory BIOs.\n    '
    client_conn.set_connect_state()
    server_conn.set_accept_state()
    for conn in [client_conn, server_conn]:
        try:
            conn.do_handshake()
        except WantReadError:
            pass
    interact_in_memory(client_conn, server_conn)
Perform the TLS handshake between two `Connection` instances connected to
each other via memory BIOs.
def handshake_in_memory(client_conn, server_conn):
    '\n    Perform the TLS handshake between two `Connection` instances connected to\n    each other via memory BIOs.\n    '
    client_conn.set_connect_state()
    server_conn.set_accept_state()
    for conn in [client_conn, server_conn]:
        try:
            conn.do_handshake()
        except WantReadError:
            pass
    interact_in_memory(client_conn, server_conn)