Add HTTP version configuration to GrpcChannelOptions#2514
Merged
JamesNK merged 5 commits intogrpc:masterfrom Aug 21, 2024
Merged
Add HTTP version configuration to GrpcChannelOptions#2514JamesNK merged 5 commits intogrpc:masterfrom
JamesNK merged 5 commits intogrpc:masterfrom
Conversation
Member
Author
|
cc @jskeet |
|
Wonderful, thank you so much! |
amcasey
approved these changes
Aug 21, 2024
| /// A <c>null</c> value doesn't override the HTTP version of gRPC calls. Defaults to <c>2.0</c>. | ||
| /// </para> | ||
| /// </summary> | ||
| public Version? HttpVersion { get; set; } |
Contributor
There was a problem hiding this comment.
I assume something blows up downstream if someone sets 2.5 or 7.0, but what happens if they select 1.1?
Contributor
There was a problem hiding this comment.
From the tests, it seems like this is handled somewhere (or might even be allowable?).
Member
Author
There was a problem hiding this comment.
1.1 will successfully create a connection if the server supports 1.1 and you're using gRPC-Web.
If you select a non-standard version then I'm guessing SocketsHttpHandler will error and tell you you're using a bad version.
Co-authored-by: Andrew Casey <amcasey@users.noreply.github.com>
oguzhand95
referenced
this pull request
in cerbos/cerbos-sdk-net
Sep 23, 2024
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [Google.Protobuf](https://redirect.github.com/protocolbuffers/protobuf) | `3.28.1` -> `3.28.2` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [Grpc.Net.Client](https://redirect.github.com/grpc/grpc-dotnet) | `2.65.0` -> `2.66.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>grpc/grpc-dotnet (Grpc.Net.Client)</summary> ### [`v2.66.0`](https://redirect.github.com/grpc/grpc-dotnet/releases/tag/v2.66.0) #### What's Changed - Bump version on master to 2.66.0-dev by [@​stanley-cheung](https://redirect.github.com/stanley-cheung) in [https://github.com/grpc/grpc-dotnet/pull/2491](https://redirect.github.com/grpc/grpc-dotnet/pull/2491) - Fix failure to create GrpcChannel under Wine compatibility layer (including Steam Proton and Apple Game Porting Toolkit) by [@​mayuki](https://redirect.github.com/mayuki) in [https://github.com/grpc/grpc-dotnet/pull/2496](https://redirect.github.com/grpc/grpc-dotnet/pull/2496) - Update .NET 9 SDK and resolve warnings by [@​sebastienros](https://redirect.github.com/sebastienros) in [https://github.com/grpc/grpc-dotnet/pull/2502](https://redirect.github.com/grpc/grpc-dotnet/pull/2502) - Bump braces from 3.0.2 to 3.0.3 in /testassets/InteropTestsGrpcWebWebsite/Tests by [@​dependabot](https://redirect.github.com/dependabot) in [https://github.com/grpc/grpc-dotnet/pull/2504](https://redirect.github.com/grpc/grpc-dotnet/pull/2504) - Bump axios from 1.6.2 to 1.7.4 in /testassets/InteropTestsGrpcWebWebsite/Tests by [@​dependabot](https://redirect.github.com/dependabot) in [https://github.com/grpc/grpc-dotnet/pull/2505](https://redirect.github.com/grpc/grpc-dotnet/pull/2505) - Update puppeteer by [@​JamesNK](https://redirect.github.com/JamesNK) in [https://github.com/grpc/grpc-dotnet/pull/2507](https://redirect.github.com/grpc/grpc-dotnet/pull/2507) - Remove internal_ci flag from interop test script by [@​JamesNK](https://redirect.github.com/JamesNK) in [https://github.com/grpc/grpc-dotnet/pull/2509](https://redirect.github.com/grpc/grpc-dotnet/pull/2509) - Fix Google auth interop test by [@​JamesNK](https://redirect.github.com/JamesNK) in [https://github.com/grpc/grpc-dotnet/pull/2512](https://redirect.github.com/grpc/grpc-dotnet/pull/2512) - \[testing] improve sanity check in jwt_token_creds interop test by [@​apolcyn](https://redirect.github.com/apolcyn) in [https://github.com/grpc/grpc-dotnet/pull/2513](https://redirect.github.com/grpc/grpc-dotnet/pull/2513) - Add HTTP version configuration to GrpcChannelOptions by [@​JamesNK](https://redirect.github.com/JamesNK) in [https://github.com/grpc/grpc-dotnet/pull/2514](https://redirect.github.com/grpc/grpc-dotnet/pull/2514) - Bump grpc.tools version to 2.66 by [@​apolcyn](https://redirect.github.com/apolcyn) in [https://github.com/grpc/grpc-dotnet/pull/2523](https://redirect.github.com/grpc/grpc-dotnet/pull/2523) - Bump webpack from 5.76.0 to 5.94.0 in /examples/Browser/Server/wwwroot by [@​dependabot](https://redirect.github.com/dependabot) in [https://github.com/grpc/grpc-dotnet/pull/2522](https://redirect.github.com/grpc/grpc-dotnet/pull/2522) - Bump elliptic from 6.5.4 to 6.5.7 in /examples/Spar/Server/ClientApp by [@​dependabot](https://redirect.github.com/dependabot) in [https://github.com/grpc/grpc-dotnet/pull/2525](https://redirect.github.com/grpc/grpc-dotnet/pull/2525) - Bump micromatch from 4.0.7 to 4.0.8 in /testassets/InteropTestsGrpcWebWebsite/Tests by [@​dependabot](https://redirect.github.com/dependabot) in [https://github.com/grpc/grpc-dotnet/pull/2524](https://redirect.github.com/grpc/grpc-dotnet/pull/2524) - Bump v2.66.x branch to 2.66.0.pre1 by [@​apolcyn](https://redirect.github.com/apolcyn) in [https://github.com/grpc/grpc-dotnet/pull/2526](https://redirect.github.com/grpc/grpc-dotnet/pull/2526) - Bump v2.66.x to v2.66.0 by [@​apolcyn](https://redirect.github.com/apolcyn) in [https://github.com/grpc/grpc-dotnet/pull/2539](https://redirect.github.com/grpc/grpc-dotnet/pull/2539) **Full Changelog**: grpc/grpc-dotnet@v2.65.0...v2.66.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/cerbos/cerbos-sdk-net). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiYXJlYS9jaSIsImJvdHMiLCJraW5kL2Nob3JlIl19--> --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Signed-off-by: Oğuzhan Durgun <oguzhandurgun95@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Oğuzhan Durgun <oguzhandurgun95@gmail.com>
1 task
This was referenced Jul 29, 2025
This was referenced Aug 5, 2025
Closed
This was referenced Aug 17, 2025
This was referenced Nov 14, 2025
This was referenced Nov 24, 2025
Closed
This was referenced Dec 8, 2025
This was referenced Dec 19, 2025
Closed
This was referenced Jan 12, 2026
This was referenced Feb 2, 2026
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.
Fixes #2404
The grpc client today can automatically upgrade to HTTP3. That is unexpected for most users and it can cause changes in behavior.
Also, there are situations where you want more exact control over HTTP version. Having to use a delegating handler is an awkward solution.
This PR:
GrpcChannelOptions.HttpVersionandGrpcChannelOptions.HttpVersionPolicy.GrpcWebHandler.HttpVersionand points users to the channel optionsRequestVersionExact. Client will use HTTP/2 unless configured otherwise.