aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_tcp.py
diff options
context:
space:
mode:
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(