Repository navigation
fix: use TLS by default for built-in gRPC connections - #114
Merged
Merged
Conversation
Use the system trust store to verify gRPC servers for A2A 1.0 and 0.3. Accept gRPC addresses advertised as HTTPS URLs in Agent Cards and keep --insecure available for plaintext servers. Fixes a2aproject#99
With TLS on by default, a plaintext gRPC server such as `a2a server --serve-transport grpc` fails the handshake with "tls: first record does not look like a TLS handshake", and the hint for the old "no transport security set" error never fires. Classify reports that failure as an IO error with a hint to pass --insecure. The test serves plaintext with grpc.Server.Serve, which answers a TLS ClientHello the way a gRPC agent does, and uses a named-field table with t.Fatalf.
newClientFromCard stripped the http(s) scheme from the card's gRPC interface URLs in place, so client.Card() returned the rewritten URLs and the client's endpoint no longer matched the agent's card. The CLI registers its own gRPC transport factories that strip the scheme only when dialing, for both the card and the --endpoint path.
--insecure turns TLS off for the built-in gRPC client, which is more than disabling certificate verification. The warning also fires when the selected transport is REST or JSON-RPC, so it describes what --insecure does without naming the transport in use.
Member
|
merging with a small fixes |
yarolegovich
approved these changes
Nov 3, 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.
The built-in gRPC client failed before connecting to a TLS-enabled agent because the CLI supplied no transport credentials by default. This change enables TLS with the system trust store for A2A 1.0 and 0.3. Local plaintext servers remain accessible with
--insecure.The same gRPC endpoint now works when passed directly or advertised as an HTTPS URL in an Agent Card. The latter case came up when comparing with the Rust SDK's TLS example.
The regression tests send a message over TLS, exercise direct and card-based connections, reject an untrusted certificate and a hostname mismatch, and cover explicit plaintext mode.
Fixes #99
Which area does this relate to?
Checklist
go mod tidy -diff,go build -mod=readonly ./...,go test -race -mod=readonly -count=1 -shuffle=on ./..., andgolangci-lint run.