Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion grpcurl.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ func BlockingDial(ctx context.Context, network, address string, creds credential
}

var err error
if strings.HasPrefix(address, "xds:///") {
if strings.HasPrefix(address, "xds://") {
// The xds:/// prefix is used to signal to the gRPC client to use an xDS server to resolve the
Comment thread
erikjoh marked this conversation as resolved.
Outdated
// target. The relevant credentials will be automatically pulled from the GRPC_XDS_BOOTSTRAP or
// GRPC_XDS_BOOTSTRAP_CONFIG env vars.
Expand Down Expand Up @@ -737,3 +737,18 @@ func (c *errSignalingCreds) ClientHandshake(ctx context.Context, addr string, ra
}
return conn, auth, err
}

// UsesXDS forwards the optional UsesXDS marker of the wrapped credentials. The
// xDS credentials returned for "xds://" targets implement this method, and
// grpc-go's cds balancer relies on a type assertion for it to decide whether to
// apply the security configuration (e.g. UpstreamTlsContext) delivered by the
// management server. Because errSignalingCreds embeds the TransportCredentials
// interface, that extra method is not promoted automatically, so we forward it
// explicitly. Without this, xDS-supplied mTLS is silently ignored and the
// connection falls back to the plain credentials.
func (c *errSignalingCreds) UsesXDS() bool {
if x, ok := c.TransportCredentials.(interface{ UsesXDS() bool }); ok {
return x.UsesXDS()
}
return false
}
Loading