Skip to content

Support multiple TLS verification server names - #2103

Open
robzienert wants to merge 3 commits into
temporalio:mainfrom
robzienert:tls-verification-server-names
Open

robzienert wants to merge 3 commits into
temporalio:mainfrom
robzienert:tls-verification-server-names

Conversation

@robzienert

@robzienert robzienert commented Nov 9, 2026 •

Copy link
Copy Markdown

Why the change

TLSConfig.verification_server_name accepts one name. Some deployments have one address that can route to servers with different certificate names, for example regional servers behind a global DNS name where each server's certificate names only its own region. These clients cannot verify the server today, and this change lets them.

Special things to note

  • verification_server_name now accepts str | Sequence[str]. A single string behaves the same as before. The bridge always receives a list, and a single string becomes a one-item list.
  • A str is checked before the sequence case, because a str is also a Sequence[str] and would otherwise be read as one-character names.
  • An empty sequence is rejected.
  • Each name runs the full standard WebPKI check: chain, validity, and name. The first match wins. If no name matches, the error from the first name is returned.

Change outline

Widened public option on TLSConfig:

 @dataclass
 class TLSConfig:
     server_root_ca_cert: bytes | None = None
     domain: str | None = None
     client_cert: bytes | None = None
     client_private_key: bytes | None = None
-    verification_server_name: str | None = None
+    verification_server_name: str | Sequence[str] | None = None

Bridge contract (ClientTlsConfig, Python and Rust):

-    verification_server_name: Option<String>,
+    verification_server_names: Option<Vec<String>>,

Verifier behavior (FixedServerNameVerifier in temporalio/bridge/src/client.rs):

 verify_server_cert(end_entity, intermediates, _connection_name, ocsp, now)
-  webpki.verify(end_entity, intermediates, fixed_name, ocsp, now)
+  for name in fixed_names
+    if webpki.verify(end_entity, intermediates, name, ocsp, now) is ok
+      return ok
+  return first error

Testing

  • tests/test_tls.py: new tests for the bridge mapping of a sequence, rejection of an empty sequence, a handshake that matches only the second name, a handshake where no name matches, and the root CA requirement. The existing single-name tests still pass.
  • A mutant that checks only the first name fails test_tls_verification_server_name_sequence_accepts_any_matching_name. A mutant that removes the str check fails 3 tests.
  • cargo clippy -- -D warnings, cargo fmt, ruff, pyright and mypy pass on the changed files.
  • Manual check against a real multi-region deployment: one TLSConfig with the four regional names connected and returned GetSystemInfo through the global address and through each of the four regional addresses.

@CLAassistant

CLAassistant commented Nov 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@robzienert
robzienert marked this pull request as ready for review November 9, 2026 02:25
@robzienert
robzienert requested a review from a team as a code owner November 9, 2026 02:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T02:28:03.455605Z 335d148 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread temporalio/service.py Resolved
TLSConfig.verification_server_name now also accepts a sequence of
names. The bridge verifier accepts a server certificate that is valid
for any one of the names. This supports targets where one address can
route to servers that present different certificate names, such as
regional servers behind a global address.

A single string keeps its behavior and maps to a one-item list in the
bridge. A string is checked before the sequence case, because a str is
also a Sequence[str]. An empty sequence is rejected.
@robzienert
robzienert force-pushed the tls-verification-server-names branch from 335d148 to 669b108 Compare November 9, 2026 16:58
Comment thread temporalio/service.py Resolved

This branch has not been deployed

No deployments
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.

3 participants