aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_certutils.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-01-06 01:34:39 +1300
committerAldo Cortesi <aldo@nullcube.com>2013-01-06 01:34:39 +1300
commite4acace8ea741af798523d6ff1d148d129f23582 (patch)
treecbb1ed314469ab45ba7d39e47dba0931a9249305 /test/test_certutils.py
parent91834ea78f36e1e89d4f19ecdddef83b0286b4d4 (diff)
downloadmitmproxy-e4acace8ea741af798523d6ff1d148d129f23582.tar.gz
mitmproxy-e4acace8ea741af798523d6ff1d148d129f23582.tar.bz2
mitmproxy-e4acace8ea741af798523d6ff1d148d129f23582.zip
Sanity-check certstore common names.
Diffstat (limited to 'test/test_certutils.py')
-rw-r--r--test/test_certutils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_certutils.py b/test/test_certutils.py
index 9b917dc6..582fb9c4 100644
--- a/test/test_certutils.py
+++ b/test/test_certutils.py
@@ -35,6 +35,15 @@ class TestCertStore:
assert c.get_cert("foo.com", [], ca)
c.cleanup()
+ def test_check_domain(self):
+ c = certutils.CertStore()
+ assert c.check_domain("foo")
+ assert c.check_domain("\x01foo")
+ assert not c.check_domain("\xfefoo")
+ assert not c.check_domain("xn--\0")
+ assert not c.check_domain("foo..foo")
+ assert not c.check_domain("foo/foo")
+
class TestDummyCert:
def test_with_ca(self):