Skip to content

Cherry-pick d33f24c: fix NODE_EXTRA_CA_CERTS missing from LaunchAgent environment on macOS#1234

Merged
alexey-pelykh merged 1 commit intomainfrom
cherry-pick/d33f24c-macos-ca-certs-launchagent
Mar 13, 2026
Merged

Cherry-pick d33f24c: fix NODE_EXTRA_CA_CERTS missing from LaunchAgent environment on macOS#1234
alexey-pelykh merged 1 commit intomainfrom
cherry-pick/d33f24c-macos-ca-certs-launchagent

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Cherry-pick of upstream d33f24c4e by @Clawborn.

Tier: AUTO-PICK

On macOS, launchd services don't inherit the shell environment, so Node's undici/fetch cannot locate the system CA bundle. This fix defaults NODE_EXTRA_CA_CERTS to /etc/ssl/cert.pem when running as a LaunchAgent without extra user configuration, for both gateway and node services.

Conflict resolution: Rebrand conflict in service-env.ts — upstream's semantic change (NODE_EXTRA_CA_CERTS: nodeCaCerts) applied with fork's REMOTECLAW_ env var names. Also fixed a missing closing brace in the test file (auto-merge artifact; will be separately fixed upstream in 6b59c87).

Depends on #1233

Cherry-picked for #662

launchd services do not inherit the shell environment, so Node's undici/fetch
cannot locate the macOS system CA bundle (/etc/ssl/cert.pem). This causes TLS
verification failures for all HTTPS requests (e.g. Telegram, webhooks) when the
gateway runs as a LaunchAgent, while the same gateway works fine in a terminal.

Add NODE_EXTRA_CA_CERTS defaulting to /etc/ssl/cert.pem on macOS in both
buildServiceEnvironment and buildNodeServiceEnvironment. User-supplied
NODE_EXTRA_CA_CERTS is always respected and takes precedence.

Fixes openclaw#22856

Co-authored-by: Clawborn <[email protected]>
(cherry picked from commit d33f24c)
@alexey-pelykh alexey-pelykh merged commit f176359 into main Mar 13, 2026
7 checks passed
@alexey-pelykh alexey-pelykh deleted the cherry-pick/d33f24c-macos-ca-certs-launchagent branch March 13, 2026 20:29
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.

1 participant