From 3095da64d77c13846aca792bfa0f6e477b0cc876 Mon Sep 17 00:00:00 2001 From: Thomas Recloux Date: Wed, 9 Nov 2016 18:43:59 +0100 Subject: [PATCH] Check that we provide HTTP/2 --- integration/https_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/integration/https_test.go b/integration/https_test.go index 36f3953f5..7bf2c2a59 100644 --- a/integration/https_test.go +++ b/integration/https_test.go @@ -30,6 +30,7 @@ func (s *HTTPSSuite) TestWithSNIConfigHandshake(c *check.C) { tlsConfig := &tls.Config{ InsecureSkipVerify: true, ServerName: "snitest.com", + NextProtos: []string{"h2", "http/1.1"}, } conn, err := tls.Dial("tcp", "127.0.0.1:4443", tlsConfig) c.Assert(err, checker.IsNil, check.Commentf("failed to connect to server")) @@ -41,6 +42,9 @@ func (s *HTTPSSuite) TestWithSNIConfigHandshake(c *check.C) { cs := conn.ConnectionState() err = cs.PeerCertificates[0].VerifyHostname("snitest.com") c.Assert(err, checker.IsNil, check.Commentf("certificate did not match SNI servername")) + + proto := conn.ConnectionState().NegotiatedProtocol + c.Assert(proto, checker.Equals, "h2") } // TestWithSNIConfigRoute involves a client sending HTTPS requests with