-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Go client must verify ALPN selected h2 #2742
Comments
Related: grpc/grpc#9991 |
Hi, I found the same problem when we intend to use rust as clients to connect go server. For example, when go server run in a mac os(don't support ALPN), rust client report that it trying to connect http/1.x server. But when using client with go, everything seems fine.... it's wired. looks like we met a problem like those issues grpc/grpc#9991 grpc/grpc#18710 our problem tikv/tikv#7312 |
I believe this is the same as #434 |
HTTP/2 uses ALPN to negotiate the protocol. But if ALPN is not supported on the server, the TLS library may let the connection progress, as the application will commonly use a fallback (typically HTTP/1).
It appears that the Go client does not detect the case where ALPN is unsupported on the server. The client should check the negotiated protocol and fail if it isn't supported (h2 or grpc-exp, etc).
This was discovered in grpc/grpc-java#5543. Fixing this may impact your users, but is also a requirement of HTTP/2.
I tested this with a hacked Java server that disabled ALPN. Wireshark is helpful to verify it is behaving as expected.
The interop client should not succeed. For comparison:
The text was updated successfully, but these errors were encountered: