{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12895","labels_url":"https://api.github.com/repos/golang/go/issues/12895/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12895/comments","events_url":"https://api.github.com/repos/golang/go/issues/12895/events","html_url":"https://github.com/golang/go/issues/12895","id":110745864,"number":12895,"title":"x/net/http2: The server should not select a banned cipher if it selects h2","user":{"login":"jay","id":965580,"avatar_url":"https://avatars.githubusercontent.com/u/965580?v=3","gravatar_id":"","url":"https://api.github.com/users/jay","html_url":"https://github.com/jay","followers_url":"https://api.github.com/users/jay/followers","following_url":"https://api.github.com/users/jay/following{/other_user}","gists_url":"https://api.github.com/users/jay/gists{/gist_id}","starred_url":"https://api.github.com/users/jay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jay/subscriptions","organizations_url":"https://api.github.com/users/jay/orgs","repos_url":"https://api.github.com/users/jay/repos","events_url":"https://api.github.com/users/jay/events{/privacy}","received_events_url":"https://api.github.com/users/jay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-09T22:26:07Z","updated_at":"2015-10-10T20:30:50Z","closed_at":null,"body":"An HTTP/2 capable server that enforces the optional [TLS 1.2 cipher suite blacklist](https://tools.ietf.org/html/rfc7540#section-9.2.2) from RFC 7540 should not select one of those ciphers if the protocol selection is h2. A client may advertise both h2 and blacklisted ciphers because it doesn't know anything about the server.\r\n\r\nFor example consider a client such as libcurl that uses nghttp2 and OpenSSL 1.0.2. If HTTP2 is enabled it will send a ClientHello that advertises protocols h2, http/1.1 and ciphers such as [... TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA ...]. The go server currently replies with a ServerHello selecting h2 and the aforementioned blacklisted cipher, which it later bans by default.\r\n\r\n~~~\r\nTLSv1.2 Record Layer: Handshake Protocol: Server Hello\r\n    Content Type: Handshake (22)\r\n    Version: TLS 1.2 (0x0303)\r\n    Length: 58\r\n    Handshake Protocol: Server Hello\r\n        Handshake Type: Server Hello (2)\r\n        Length: 54\r\n        Version: TLS 1.2 (0x0303)\r\n        Random\r\n            GMT Unix Time: Jan 21, 2084 01:52:46.000000000 Eastern Standard Time\r\n            Random Bytes: 9dddda38a42111e70f3b934867a054c7a17df8aa27ef5139...\r\n        Session ID Length: 0\r\n        Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014)\r\n        Compression Method: null (0)\r\n        Extensions Length: 14\r\n        Extension: renegotiation_info\r\n            Type: renegotiation_info (0xff01)\r\n            Length: 1\r\n            Renegotiation Info extension\r\n                Renegotiation info extension length: 0\r\n        Extension: Application Layer Protocol Negotiation\r\n            Type: Application Layer Protocol Negotiation (0x0010)\r\n            Length: 5\r\n            ALPN Extension Length: 3\r\n            ALPN Protocol\r\n                ALPN string length: 2\r\n                ALPN Next Protocol: h2\r\n~~~\r\n\r\nRef bagder/curl#406"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/147123009","html_url":"https://github.com/golang/go/issues/12895#issuecomment-147123009","issue_url":"https://api.github.com/repos/golang/go/issues/12895","id":147123009,"user":{"login":"agl","id":21203,"avatar_url":"https://avatars.githubusercontent.com/u/21203?v=3","gravatar_id":"","url":"https://api.github.com/users/agl","html_url":"https://github.com/agl","followers_url":"https://api.github.com/users/agl/followers","following_url":"https://api.github.com/users/agl/following{/other_user}","gists_url":"https://api.github.com/users/agl/gists{/gist_id}","starred_url":"https://api.github.com/users/agl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agl/subscriptions","organizations_url":"https://api.github.com/users/agl/orgs","repos_url":"https://api.github.com/users/agl/repos","events_url":"https://api.github.com/users/agl/events{/privacy}","received_events_url":"https://api.github.com/users/agl/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T20:30:50Z","updated_at":"2015-10-10T20:30:50Z","body":"The intended configuration for this is that the server sets `PreferServerCipherSuites` in the `tls.Config` and moves the HTTP/2 compatible cipher suites to the top of `CipherSuites`"}}