Skip to content

feat(client): reach a sidecar over mTLS through an SNI-routing proxy - #862

Draft
lrascao wants to merge 2 commits into
dapr:mainfrom
lrascao:grpc-mtls-client
Draft

lrascao wants to merge 2 commits into
dapr:mainfrom
lrascao:grpc-mtls-client

Conversation

@lrascao

@lrascao lrascao commented Nov 6, 2026 •

Copy link
Copy Markdown

Description

DAPR_GRPC_ENDPOINT takes ?authority=, sent as :authority and SNI, so a proxy can route the connection while the endpoint only has to reach the proxy.

The client reads the gRPC TLS settings the Java SDK reads, with the same meaning: DAPR_GRPC_TLS_CERT_PATH and DAPR_GRPC_TLS_KEY_PATH are the client certificate, DAPR_GRPC_TLS_CA_PATH replaces the system roots, and setting any of them turns TLS on. DAPR_GRPC_TLS_SERVER_SPIFFE_ID swaps the host name check for a SPIFFE ID check, for a server whose certificate names no host, such as a daprd reached over mTLS. Unlike Java, a certificate without its key is an error rather than ignored.

A dial timeout now reports the last connection error.

DAPR_GRPC_ENDPOINT takes ?authority=, sent as :authority and SNI so a proxy
can route the connection while the target only reaches the proxy. With
DAPR_CLIENT_TLS_CERT_FILE/KEY_FILE and DAPR_TLS_TRUST_ANCHORS_FILE set, the
client presents that certificate and holds the server to a SPIFFE ID
(DAPR_SERVER_SPIFFE_ID, default its own) instead of a host name. A dial
timeout now reports the last connection error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lrascao
lrascao requested review from a team as code owners November 6, 2026 17:43
@lrascao
lrascao marked this pull request as draft November 6, 2026 17:43
@javier-aliaga

Copy link
Copy Markdown
Contributor

@lrascao can we use this var names DAPR_GRPC_TLS_CERT_PATH, DAPR_GRPC_TLS_KEY_PATH, DAPR_GRPC_TLS_CA_PATH and DAPR_GRPC_TLS_SERVER_SPIFFE_ID ?? The first 3 already exists on Java sdk for the same purpose.

…eaning

DAPR_GRPC_TLS_CERT_PATH, DAPR_GRPC_TLS_KEY_PATH and DAPR_GRPC_TLS_CA_PATH
now behave as in the Java SDK: any of them turns TLS on, the CA replaces
the system roots, and the server is checked by host name. The SPIFFE ID
check runs only when DAPR_GRPC_TLS_SERVER_SPIFFE_ID is set, and needs the CA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lrascao

lrascao commented Nov 11, 2026

Copy link
Copy Markdown
Author

@lrascao can we use this var names DAPR_GRPC_TLS_CERT_PATH, DAPR_GRPC_TLS_KEY_PATH, DAPR_GRPC_TLS_CA_PATH and DAPR_GRPC_TLS_SERVER_SPIFFE_ID ?? The first 3 already exists on Java sdk for the same purpose.

Renamed, and they now behave as they do in Java: any of them turns TLS on, the CA replaces the system roots, and the server is checked by host name. The SPIFFE check only runs when DAPR_GRPC_TLS_SERVER_SPIFFE_ID is set. One difference I kept: a cert without its key fails here instead of being ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants