def _retrieveRemoteCertificate(self, From, port=port):
        CS = self.service.certificateStorage
        host = str(From.domainAddress())
        p = AMP()
        p.wrapper = self.wrapper
        f = protocol.ClientCreator(reactor, lambda: p)
        connD = f.connectTCP(host, port)

        def connected(proto):
            dhost = From.domainAddress()
            iddom = proto.callRemote(Identify, subject=dhost)
            def gotCert(identifyBox):
                theirCert = identifyBox['certificate']
                theirIssuer = theirCert.getIssuer().commonName
                theirName = theirCert.getSubject().commonName
                if (theirName != str(dhost)):
                    raise VerifyError(
                        "%r claimed it was %r in IDENTIFY response"
                        % (theirName, dhost))
                if (theirIssuer != str(dhost)):
                    raise VerifyError(
                        "self-signed %r claimed it was issued by "
                        "%r in IDENTIFY response" % (dhost, theirIssuer))
                def storedCert(ignored):
                    return theirCert
                return CS.storeSelfSignedCertificate(
                    str(dhost), theirCert).addCallback(storedCert)
            def nothingify(x):
                proto.transport.loseConnection()
                return x
            return iddom.addCallback(gotCert).addBoth(nothingify)
        connD.addCallback(connected)
        return connD
Test if PackageFinder skips invalid wheel filenames
dataset/ETHPy150Open twisted/vertex/vertex/q2q.py/Q2Q._retrieveRemoteCertificate--crossover with--dataset/ETHPy150Open pypa/pip/tests/unit/test_finder.py/TestWheel.test_skip_invalid_wheel_link