go16.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // 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. // +build go1.6
  5. package http2
  6. import (
  7. "crypto/tls"
  8. "net/http"
  9. "time"
  10. )
  11. func transportExpectContinueTimeout(t1 *http.Transport) time.Duration {
  12. return t1.ExpectContinueTimeout
  13. }
  14. // isBadCipher reports whether the cipher is blacklisted by the HTTP/2 spec.
  15. func isBadCipher(cipher uint16) bool {
  16. switch cipher {
  17. case tls.TLS_RSA_WITH_RC4_128_SHA,
  18. tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
  19. tls.TLS_RSA_WITH_AES_128_CBC_SHA,
  20. tls.TLS_RSA_WITH_AES_256_CBC_SHA,
  21. tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
  22. tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
  23. tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
  24. tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
  25. tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
  26. tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
  27. tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
  28. tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
  29. tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
  30. // Reject cipher suites from Appendix A.
  31. // "This list includes those cipher suites that do not
  32. // offer an ephemeral key exchange and those that are
  33. // based on the TLS null, stream or block cipher type"
  34. return true
  35. default:
  36. return false
  37. }
  38. }