diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/net/test_tcp.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/mitmproxy/net/test_tcp.py b/test/mitmproxy/net/test_tcp.py index 3238ab2f..c5b026ef 100644 --- a/test/mitmproxy/net/test_tcp.py +++ b/test/mitmproxy/net/test_tcp.py @@ -800,3 +800,18 @@ class TestSSLKeyLogger(tservers.ServerTestBase): tcp.SSLKeyLogger.create_logfun("test"), tcp.SSLKeyLogger) assert not tcp.SSLKeyLogger.create_logfun(False) + + +class TestSSLInvalidMethod(tservers.ServerTestBase): + handler = EchoHandler + ssl = True + + def test_invalid_ssl_method_should_fail(self): + fake_ssl_method = 100500 + c = tcp.TCPClient(("127.0.0.1", self.port)) + with c.connect(): + tutils.raises( + exceptions.TlsException, + c.convert_to_ssl, + method=fake_ssl_method + ) |