diff options
author | Yoginski <yoginski@gmail.com> | 2016-11-21 14:40:09 +0600 |
---|---|---|
committer | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-11-21 09:40:09 +0100 |
commit | ebff5f2466ab630f3642283c63823b2596f0b86c (patch) | |
tree | 3572a0ec4cfeb50870016d332a467fc7da8f3e99 /test | |
parent | c90405253a2345b7722bdb68906561e4c50dc1bf (diff) | |
download | mitmproxy-ebff5f2466ab630f3642283c63823b2596f0b86c.tar.gz mitmproxy-ebff5f2466ab630f3642283c63823b2596f0b86c.tar.bz2 mitmproxy-ebff5f2466ab630f3642283c63823b2596f0b86c.zip |
Descriptive error message for SSL context initialization failure (#1767)
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 + ) |