aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2014-03-02 17:27:24 +1300
committerAldo Cortesi <aldo@nullcube.com>2014-03-02 17:27:24 +1300
commitf373ac5b6c443d0e633323e39b846fbe78822c2c (patch)
tree7323cfea5bda32b019c927da58d8b44163883cf3 /test
parent863b1e14552f5216ae4c47bf6dfe9b68ff2ca13b (diff)
downloadmitmproxy-f373ac5b6c443d0e633323e39b846fbe78822c2c.tar.gz
mitmproxy-f373ac5b6c443d0e633323e39b846fbe78822c2c.tar.bz2
mitmproxy-f373ac5b6c443d0e633323e39b846fbe78822c2c.zip
Improve explicit certificate specification
- Support cert/key in the same PEM file - Rationalize arguments, expand tests, clean up a bit
Diffstat (limited to 'test')
-rw-r--r--test/test_proxy.py9
-rw-r--r--test/tservers.py1
2 files changed, 7 insertions, 3 deletions
diff --git a/test/test_proxy.py b/test/test_proxy.py
index c42d66e7..5ff00290 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -70,9 +70,12 @@ class TestProcessProxyOptions:
def test_simple(self):
assert self.p()
- def test_cert(self):
- self.assert_noerr("--cert", tutils.test_data.path("data/testkey.pem"))
- self.assert_err("does not exist", "--cert", "nonexistent")
+ def test_certfile_keyfile(self):
+ self.assert_noerr("--certfile", tutils.test_data.path("data/testkey.pem"))
+ self.assert_err("does not exist", "--certfile", "nonexistent")
+
+ self.assert_noerr("--keyfile", tutils.test_data.path("data/testkey.pem"))
+ self.assert_err("does not exist", "--keyfile", "nonexistent")
def test_confdir(self):
with tutils.tmpdir() as confdir:
diff --git a/test/tservers.py b/test/tservers.py
index 812e8921..a0f37c98 100644
--- a/test/tservers.py
+++ b/test/tservers.py
@@ -128,6 +128,7 @@ class ProxTestBase(object):
d["clientcerts"] = tutils.test_data.path("data/clientcert")
if cls.certfile:
d["certfile"] =tutils.test_data.path("data/testkey.pem")
+ d["keyfile"] =tutils.test_data.path("data/testkey.pem")
return d