aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_tcp.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2015-05-28 17:46:44 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2015-05-29 15:31:22 +0200
commit780836b182cd982b978f16218299f2b77a8ed204 (patch)
tree4cb5648b87151f54e70c6fb813dc709df0232cb2 /test/test_tcp.py
parentd50b9be0d5dab1772f0edcbfa89542ef9425e7bf (diff)
downloadmitmproxy-780836b182cd982b978f16218299f2b77a8ed204.tar.gz
mitmproxy-780836b182cd982b978f16218299f2b77a8ed204.tar.bz2
mitmproxy-780836b182cd982b978f16218299f2b77a8ed204.zip
add ALPN support to TCP abstraction
Diffstat (limited to 'test/test_tcp.py')
-rw-r--r--test/test_tcp.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_tcp.py b/test/test_tcp.py
index 2bf492fa..ab786d3f 100644
--- a/test/test_tcp.py
+++ b/test/test_tcp.py
@@ -389,6 +389,24 @@ class TestTimeOut(test.ServerTestBase):
tutils.raises(tcp.NetLibTimeout, c.rfile.read, 10)
+class TestALPN(test.ServerTestBase):
+ handler = HangHandler
+ ssl = dict(
+ cert=tutils.test_data.path("data/server.crt"),
+ key=tutils.test_data.path("data/server.key"),
+ request_client_cert=False,
+ v3_only=False,
+ alpn_select="h2"
+ )
+
+ def test_alpn(self):
+ c = tcp.TCPClient(("127.0.0.1", self.port))
+ c.connect()
+ c.convert_to_ssl(alpn_protos=["h2"])
+ print "ALPN: %s" % c.get_alpn_proto_negotiated()
+ assert c.get_alpn_proto_negotiated() == "h2"
+
+
class TestSSLTimeOut(test.ServerTestBase):
handler = HangHandler
ssl = dict(