def test_set_verify_callback_connection_argument(self):
    '\n        The first argument passed to the verify callback is the\n        `Connection` instance for which verification is taking place.\n        '
    serverContext = Context(TLSv1_METHOD)
    serverContext.use_privatekey(load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM))
    serverContext.use_certificate(load_certificate(FILETYPE_PEM, cleartextCertificatePEM))
    serverConnection = Connection(serverContext, None)

    class VerifyCallback(object):

        def callback(self, connection, *args):
            self.connection = connection
            return 1
    verify = VerifyCallback()
    clientContext = Context(TLSv1_METHOD)
    clientContext.set_verify(VERIFY_PEER, verify.callback)
    clientConnection = Connection(clientContext, None)
    clientConnection.set_connect_state()
    handshake_in_memory(clientConnection, serverConnection)
    assert (verify.connection is clientConnection)
The first argument passed to the verify callback is the
`Connection` instance for which verification is taking place.
def test_set_verify_callback_connection_argument(self):
    '\n        The first argument passed to the verify callback is the\n        `Connection` instance for which verification is taking place.\n        '
    serverContext = Context(TLSv1_METHOD)
    serverContext.use_privatekey(load_privatekey(FILETYPE_PEM, cleartextPrivateKeyPEM))
    serverContext.use_certificate(load_certificate(FILETYPE_PEM, cleartextCertificatePEM))
    serverConnection = Connection(serverContext, None)

    class VerifyCallback(object):

        def callback(self, connection, *args):
            self.connection = connection
            return 1
    verify = VerifyCallback()
    clientContext = Context(TLSv1_METHOD)
    clientContext.set_verify(VERIFY_PEER, verify.callback)
    clientConnection = Connection(clientContext, None)
    clientConnection.set_connect_state()
    handshake_in_memory(clientConnection, serverConnection)
    assert (verify.connection is clientConnection)