aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/http2_interop/http2interop.go
diff options
context:
space:
mode:
authorGravatar Carl Mastrangelo <notcarl@google.com>2015-11-18 16:48:57 -0800
committerGravatar Carl Mastrangelo <notcarl@google.com>2015-11-18 16:48:57 -0800
commit8a1cdec2ae0324b5d1bdf92197ca7ae3105163fc (patch)
tree684780ed6275d3b1ed3529eb2599901ece04b4f3 /tools/http2_interop/http2interop.go
parentbef0d6d9f6c9ae105b9562a1c7b75d615dd35d8e (diff)
Add cipher suite test to http2 interop tests, and honor test_case flag
Diffstat (limited to 'tools/http2_interop/http2interop.go')
-rw-r--r--tools/http2_interop/http2interop.go52
1 files changed, 52 insertions, 0 deletions
diff --git a/tools/http2_interop/http2interop.go b/tools/http2_interop/http2interop.go
index 8585a044e5..bef8b0b656 100644
--- a/tools/http2_interop/http2interop.go
+++ b/tools/http2_interop/http2interop.go
@@ -252,6 +252,58 @@ func testTLSApplicationProtocol(ctx *HTTP2InteropCtx) error {
return nil
}
+func testTLSBadCipherSuites(ctx *HTTP2InteropCtx) error {
+ config := buildTlsConfig(ctx)
+ // These are the suites that Go supports, but are forbidden by http2.
+ config.CipherSuites = []uint16{
+ tls.TLS_RSA_WITH_RC4_128_SHA,
+ tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
+ tls.TLS_RSA_WITH_AES_128_CBC_SHA,
+ tls.TLS_RSA_WITH_AES_256_CBC_SHA,
+ tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
+ tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
+ tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
+ tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
+ tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
+ tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
+ tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
+ }
+ conn, err := connectWithTls(ctx, config)
+ if err != nil {
+ return err
+ }
+ defer conn.Close()
+ conn.SetDeadline(time.Now().Add(defaultTimeout))
+
+ if err := http2Connect(conn, nil); err != nil {
+ return err
+ }
+
+ for {
+ f, err := parseFrame(conn)
+ if err != nil {
+ return err
+ }
+ if gf, ok := f.(*GoAwayFrame); ok {
+ return fmt.Errorf("Got goaway frame %d", gf.Code)
+ }
+ }
+ return nil
+}
+
+func http2Connect(c net.Conn, sf *SettingsFrame) error {
+ if _, err := c.Write([]byte(Preface)); err != nil {
+ return err
+ }
+ if sf == nil {
+ sf = &SettingsFrame{}
+ }
+ if err := streamFrame(c, sf); err != nil {
+ return err
+ }
+ return nil
+}
+
func connect(ctx *HTTP2InteropCtx) (net.Conn, error) {
var conn net.Conn
var err error