Repository navigation
Send an :authority on the vminitd gRPC connection - #989
Merged
Merged
Conversation
The guest agent connection wraps an already-connected vsock, so grpc-swift has no target address to derive an :authority from and sends none. The guest agent does not require one, but gRPC-Go v1.82.2, v1.83.2 and v1.84.0 reject requests without an :authority (grpc-go #9365), so send one to stay compatible with servers that enforce it. Set http2.authority explicitly, keeping the existing idle-timeout setting. Factor the configuration into Vminitd.transportConfig() and add tests so neither setting silently returns to the defaults. This is precautionary: the vminitd server is grpc-swift, which does not reject requests without an :authority.
noah-thor
approved these changes
Oct 23, 2026
5 of 6 tasks
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.
Summary
Vminitdconnects to the guest agent by wrapping an already-connected vsock withHTTP2ClientTransport.WrappedChannel.wrapping(...). There is no target address to derive an:authorityfrom andConfig.http2.authoritydefaults tonil, so the client sends requests with no:authorityheader.This sets
http2.authorityexplicitly, keeping the existingconnection.maxIdleTime = nilsetting. The configuration is factored intoVminitd.transportConfig()so it can be tested.This is precautionary, not a bug fix
The guest agent is served by grpc-swift, which does not reject requests without an
:authority, so nothing is broken today. The reason to do this is that grpc-go v1.82.2, v1.83.2 and v1.84.0 and later do reject them withInternal: "no host or :authority header present"(grpc/grpc-go#9365). A client that wraps a pre-connected socket the way this one does stops working against any server that enforces it. apple/container hit this with its builder shim, which is a grpc-go server (apple/container#2428 sets an authority there). Sending one here keeps this client compatible if the server stack changes, and the tests stop the configuration from silently returning to the defaults.The authority value is not significant: the agent does not route on it and there is no TLS.
"vminitd"is a valid host name.Testing
Added
VminitdTransportConfigTests::authority;Both pass with
swift test --filter VminitdTransportConfigTests. I have not run a full container workload through the changed client, so the effect on a live vminitd connection is untested; grpc-swift servers do not validate the header, so I expect none.