Ejemplo n.º 1
0
 def testVerifyClientGood(self):
     self.start("localhost-a.key", "localhost-a.cert", ["ca.cert"], verify=True)
     config = self.config.copy()
     config['ssl_key'] = dummy_server.ssl_path("localhost-b.key")
     config['ssl_cert'] = dummy_server.ssl_path("localhost-b.cert")
     d = self.startQuery(config, data="post data")
     d.addCallback(self.assertEquals, "post data")
     return d
Ejemplo n.º 2
0
 def testVerifyServerGood(self):
     self.start("localhost-a.key", "localhost-a.cert")
     config = self.config.copy()
     config['ssl_cacert'] = dummy_server.ssl_path("ca.cert")
     d = self.startQuery(config, data="post data")
     d.addCallback(self.assertEquals, "post data")
     return d
Ejemplo n.º 3
0
 def testVerifyServerGood(self):
     self.start("localhost-a.key", "localhost-a.cert")
     config = self.config.copy()
     config['ssl_cacert'] = dummy_server.ssl_path("ca.cert")
     d = self.startQuery(config)
     d.addBoth(self.assertEquals, "hello\n")
     return d
Ejemplo n.º 4
0
    def testVerifyServerBad(self):
        self.start("localhost-a.key", "localhost-a.cert")
        config = self.config.copy()
        config['ssl_cacert'] = dummy_server.ssl_path("bogus-ca.cert")

        def check(result):
            self.assertIsInstance(result, errors.Failure)
            self.assertIsInstance(result.value, errors.TestCritical)

        d = self.startQuery(config, data="post data")
        d.addBoth(check)
        return d