Skip to content

fix(cli): keep public CA roots for macOS one-shot commands - #112868

Merged
steipete merged 1 commit into
mainfrom
steipete/gemini-provider-ca-regression
Jul 23, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/gemini-provider-ca-regression

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #112862
Related: #89655
Follow-up to #110341

What Problem This Solves

Fixes an issue where macOS one-shot commands disabled Keychain CA loading to avoid a shutdown hang but selected an unconfigured OpenSSL CA store. Valid provider calls could then fail with UNABLE_TO_GET_ISSUER_CERT_LOCALLY even though plain Node, curl, and direct provider requests succeeded.

Why This Change Was Made

One-shot macOS respawns now use Node's bundled public CA roots instead of --use-openssl-ca. This retains the original shutdown-hang mitigation—NODE_USE_SYSTEM_CA stays disabled in the child—while ensuring public provider TLS does not depend on a version-manager Node build having SSL_CERT_FILE configured. Explicit --use-system-ca remains the opt-in for private roots available only through macOS Keychain.

The fix stays in CLI lifecycle ownership. Provider transports and Undici dispatchers continue inheriting the process CA policy and do not gain provider-specific trust exceptions.

User Impact

macOS users can run one-shot provider commands such as openclaw agent --local without losing public TLS trust or hanging at process shutdown. Private enterprise/Keychain roots remain available through the existing explicit system-CA flag.

Evidence

  • Current-main authenticated Gemini reproduction: onboarding succeeded, then the default one-shot respawn failed with UNABLE_TO_GET_ISSUER_CERT_LOCALLY.
  • Same environment with explicit --use-system-ca: onboarding 0, agent 0, LIVE_OK, no exit timeout.
  • Patched default bundled-CA respawn: onboarding 0, agent 0, LIVE_OK, no exit timeout.
  • Deterministic no-credential probes: system CA and bundled CA reached the Google endpoint; generated OpenSSL mode failed TLS.
  • node scripts/run-vitest.mjs src/entry.respawn.test.ts src/cli/gateway-backed-exit.process.test.ts: 29/29 passed.
  • Targeted formatting, lint, and git diff --check: clean.
  • Codex autoreview (gpt-5.6-sol, xhigh): no accepted or actionable findings.

AI-assisted: yes. The root cause and Node/Undici trust-store contracts were reviewed before implementation.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 23, 2026
@steipete
steipete marked this pull request as ready for review July 23, 2026 03:52
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for head b0321718821f278683fe4e0062b3b21c5c171c06:

  • Authenticated current-main Gemini reproduction: onboarding succeeded; generated OpenSSL one-shot mode failed with UNABLE_TO_GET_ISSUER_CERT_LOCALLY.
  • Explicit --use-system-ca: onboarding 0, agent 0, LIVE_OK, no exit timeout.
  • Patched bundled-CA default: onboarding 0, agent 0, LIVE_OK, no exit timeout.
  • Deterministic no-credential probes isolated the trust-store difference: system and bundled modes reached Google; OpenSSL mode failed TLS.
  • node scripts/run-vitest.mjs src/entry.respawn.test.ts src/cli/gateway-backed-exit.process.test.ts: 29/29 passed.
  • Targeted formatting, lint, git diff --check, exact-head hosted CI, and final Codex autoreview are green.

Known proof gaps: none for the bounded CA policy correction. Provider transports remain unchanged; explicit system-CA opt-in and interactive/foreground exclusions are preserved.

@steipete
steipete merged commit 7bbc6c2 into main Jul 23, 2026
187 of 189 checks passed
@steipete
steipete deleted the steipete/gemini-provider-ca-regression branch July 23, 2026 04:33
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: macOS one-shot CLI drops public TLS trust

1 participant