'The first argument passed to the verify callback is the
:py:class:`Connection` instance for which verification is taking place.'

def test_set_verify_callback_connection_argument(self):

    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()
    self._handshakeInMemory(clientConnection, serverConnection)
    self.assertIdentical(verify.connection, clientConnection)
