The curl sub-command should support --http2-prior-knowledge with "https" URLs#2342
Merged
The curl sub-command should support --http2-prior-knowledge with "https" URLs#2342
--http2-prior-knowledge with "https" URLs#2342Conversation
pkwarren
approved these changes
Aug 3, 2023
--http2-prior-knowledge with "https" URLs--http2-prior-knowledge with "https" URLs
bufdev
approved these changes
Aug 3, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously,
buf curlwould complain if you tried to use--http2-prior-knowledgewith secure "https" URLs.Now, the flag is accepted and the client will only use HTTP/2. This basically removes "http/1.1" from the set of supported protocols during ALPN, and if the server does not support ALPN (i.e. does not pick a protocol), it defaults to HTTP/2 (whereas it was previously defaulting to HTTP 1.1).
This can be used to work with secure servers that expect HTTP/2 but don't correctly implement ALPN to select "h2". This could be the case when using network load balancers that terminate TLS (layer 4, instead of layer 7).
I tested this locally against a server using the grpc-go runtime (it does not use "net/http" and only supports HTTP/2). I hacked the runtime so that it did not use ALPN during the TLS handshake. Without
--http2-prior-knowledge, abuf curlcommand fails since it is sending an HTTP 1.1 request to a server expecting HTTP/2. But with the flag, the request succeeds.