Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/http2: Expose isBadCipher #30407

jefferai opened this Issue Feb 26, 2019 · 3 comments


None yet
4 participants
Copy link

jefferai commented Feb 26, 2019

$ go 1.11.5

When manually specifying server ciphers, it is possible to specify a set of valid TLS 1.2 ciphers that are blacklisted in the HTTP/2 spec. This is a known potential issue; from the spec section 9.2.2:

The black list includes the cipher suite that TLS 1.2 makes mandatory, which means that TLS 1.2 deployments could have non-intersecting sets of permitted cipher suites. To avoid this problem causing TLS handshake failures, deployments of HTTP/2 that use TLS 1.2 MUST support TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 [TLS-ECDHE] with the P-256 elliptic curve [FIPS186].

Although this is in theory enough to prevent handshake failures, highly security conscious/paranoid users may not want to (or be allowed to) use RSA and want further control over exactly which ciphers are in use.

There is an isBadCipher function in the package that in theory could be used to check whether a user's submitted set of ciphers will cause blacklisting issues when using HTTP/2, however since it's not exported client code cannot use it to perform a simple check when evaluating a client's chosen cipher suites.

This is a simple request to expose that function. There is no obvious reason why the behavior of that function should ever change outside of a spec revamp, so it seems fairly safe to do so.


This comment has been minimized.

Copy link

bcmills commented Feb 27, 2019


This comment has been minimized.

Copy link

FiloSottile commented Apr 17, 2019

What's the intended use case for this? Checking if user-configured ciphers are ok to use with HTTP/2? Would a "HTTP2BadCipher" field in the CipherSuite struct in #30325 (comment) work?


This comment has been minimized.

Copy link

bradfitz commented Apr 17, 2019

@FiloSottile, putting HTTP/2-specific details in a non-http2 package sounds gross.

I'm fine exporting a func in x/net/http2. It's already full of http2-specific gunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.