コード例 #1
0
ファイル: test_utils.py プロジェクト: kost/mitmproxy
    def test_all(self):
        d = self.tmpdir()
        path = os.path.join(d, "foo/cert.cnf")
        assert utils.dummy_ca(path)
        assert os.path.exists(path)

        path = os.path.join(d, "foo/cert2.pem")
        assert utils.dummy_ca(path)
        assert os.path.exists(path)
        assert os.path.exists(os.path.join(d, "foo/cert2-cert.pem"))
        assert os.path.exists(os.path.join(d, "foo/cert2-cert.p12"))
コード例 #2
0
    def test_all(self):
        d = self.tmpdir()
        path = os.path.join(d, "foo/cert.cnf")
        assert utils.dummy_ca(path)
        assert os.path.exists(path)

        path = os.path.join(d, "foo/cert2.pem")
        assert utils.dummy_ca(path)
        assert os.path.exists(path)
        assert os.path.exists(os.path.join(d, "foo/cert2-cert.pem"))
        assert os.path.exists(os.path.join(d, "foo/cert2-cert.p12"))
コード例 #3
0
ファイル: test_utils.py プロジェクト: kost/mitmproxy
 def test_with_ca(self):
     d = self.tmpdir()
     cacert = os.path.join(d, "foo/cert.cnf")
     assert utils.dummy_ca(cacert)
     assert utils.dummy_cert(os.path.join(d, "foo"), cacert, "foo.com")
     assert os.path.exists(os.path.join(d, "foo", "foo.com.pem"))
     # Short-circuit
     assert utils.dummy_cert(os.path.join(d, "foo"), cacert, "foo.com")
コード例 #4
0
 def test_with_ca(self):
     d = self.tmpdir()
     cacert = os.path.join(d, "foo/cert.cnf")
     assert utils.dummy_ca(cacert)
     assert utils.dummy_cert(os.path.join(d, "foo"), cacert, "foo.com")
     assert os.path.exists(os.path.join(d, "foo", "foo.com.pem"))
     # Short-circuit
     assert utils.dummy_cert(os.path.join(d, "foo"), cacert, "foo.com")
コード例 #5
0
 def test_with_ca(self):
     d = self.tmpdir()
     cacert = os.path.join(d, "foo/cert.cnf")
     assert utils.dummy_ca(cacert)
     p = utils.dummy_cert(
         os.path.join(d, "foo"),
         cacert,
         "foo.com",
         ["one.com", "two.com", "*.three.com"]
     )
     assert os.path.exists(p)
     
     # Short-circuit
     assert utils.dummy_cert(
         os.path.join(d, "foo"),
         cacert,
         "foo.com",
         []
     )