From 34bf3a2496ee82e1142547b95b28a0918a911bff Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 28 Nov 2016 13:29:06 +0100 Subject: fix #1783 (#1794) --- test/mitmproxy/net/test_tcp.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') 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 -- cgit v1.2.3