blob: 2b72855f552103b240eb8f086e5aaae88380a586 [file] [log] [blame]
Brad Fitzpatrick202ff482016-05-19 05:29:09 +00001// Copyright 2016 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build go1.6
6
7package http2
8
9import (
Jonathan Rudenbergb400c2e2016-06-19 15:44:24 -040010 "crypto/tls"
Brad Fitzpatrick202ff482016-05-19 05:29:09 +000011 "net/http"
12 "time"
13)
14
15func transportExpectContinueTimeout(t1 *http.Transport) time.Duration {
16 return t1.ExpectContinueTimeout
17}
Jonathan Rudenbergb400c2e2016-06-19 15:44:24 -040018
19// isBadCipher reports whether the cipher is blacklisted by the HTTP/2 spec.
20func isBadCipher(cipher uint16) bool {
21 switch cipher {
22 case tls.TLS_RSA_WITH_RC4_128_SHA,
23 tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
24 tls.TLS_RSA_WITH_AES_128_CBC_SHA,
25 tls.TLS_RSA_WITH_AES_256_CBC_SHA,
26 tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
27 tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
28 tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
29 tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
30 tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
31 tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
32 tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
33 tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
34 tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
35 // Reject cipher suites from Appendix A.
36 // "This list includes those cipher suites that do not
37 // offer an ephemeral key exchange and those that are
38 // based on the TLS null, stream or block cipher type"
39 return true
40 default:
41 return false
42 }
43}