not_go16.go 1.2 KB

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