aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-11-28 13:29:06 +0100
committerThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-11-28 13:29:06 +0100
commit34bf3a2496ee82e1142547b95b28a0918a911bff (patch)
tree83c7ec7cddbb165d256f1eb771ebcc8de004d770 /test
parente64d2ce829a7d2019d6f9c085fb99aa199782014 (diff)
downloadmitmproxy-34bf3a2496ee82e1142547b95b28a0918a911bff.tar.gz
mitmproxy-34bf3a2496ee82e1142547b95b28a0918a911bff.tar.bz2
mitmproxy-34bf3a2496ee82e1142547b95b28a0918a911bff.zip
fix #1783 (#1794)
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/net/test_tcp.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/mitmproxy/net/test_tcp.py b/test/mitmproxy/net/test_tcp.py
index c5b026ef..cf3d30f7 100644
--- a/test/mitmproxy/net/test_tcp.py
+++ b/test/mitmproxy/net/test_tcp.py
@@ -199,6 +199,18 @@ class TestSSLv3Only(tservers.ServerTestBase):
tutils.raises(exceptions.TlsException, c.convert_to_ssl, sni="foo.com")
+class TestInvalidTrustFile(tservers.ServerTestBase):
+ def test_invalid_trust_file_should_fail(self):
+ c = tcp.TCPClient(("127.0.0.1", self.port))
+ with c.connect():
+ with tutils.raises(exceptions.TlsException):
+ c.convert_to_ssl(
+ sni="example.mitmproxy.org",
+ verify_options=SSL.VERIFY_PEER,
+ ca_pemfile=tutils.test_data.path("mitmproxy/net/data/verificationcerts/generate.py")
+ )
+
+
class TestSSLUpstreamCertVerificationWBadServerCert(tservers.ServerTestBase):
handler = EchoHandler