The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 13:00 UTC
fix(desktop): import CA trust variables from the login shell (#19604)
maria committed
Oct 14, 2026 at 22:25 UTC
aa81d1203ea43c3b6cc09c5442559fa0cf18db63
2 files changed
+35
apps/desktop/src/shell/DesktopShellEnvironment.test.ts
+26
@@ -367,6 +367,32 @@ describe("DesktopShellEnvironment", () => {
367
}),
368
);
369
370
+ it.effect("hydrates missing CA trust variables from the login shell", () =>
371
+ Effect.gen(function* () {
372
+ const env: NodeJS.ProcessEnv = {
373
+ SHELL: "/bin/zsh",
374
+ PATH: "/usr/bin",
375
+ SSL_CERT_DIR: "/etc/ssl/certs",
376
+ };
377
+
378
+ yield* runShellEnvironment({
379
+ env,
380
+ platform: "darwin",
381
+ handler: () =>
382
+ envOutput({
383
+ PATH: "/opt/zerobrew/bin:/usr/bin",
384
+ SSL_CERT_FILE: "/opt/zerobrew/etc/ca-certificates/cacert.pem",
385
+ SSL_CERT_DIR: "/opt/zerobrew/etc/ca-certificates",
386
+ NODE_EXTRA_CA_CERTS: "/Users/me/corp-root.pem",
387
+ }),
388
+ });
389
+
390
+ assert.equal(env.SSL_CERT_FILE, "/opt/zerobrew/etc/ca-certificates/cacert.pem");
391
+ assert.equal(env.SSL_CERT_DIR, "/etc/ssl/certs");
392
+ assert.equal(env.NODE_EXTRA_CA_CERTS, "/Users/me/corp-root.pem");
393
+ }),
394
+ );
395
+
396
it.effect("keeps mise's PATH record with the login shell PATH", () =>
397
Effect.gen(function* () {
398
const env: NodeJS.ProcessEnv = {
apps/desktop/src/shell/DesktopShellEnvironment.ts
+9
@@ -86,6 +86,9 @@ const LOGIN_SHELL_ENV_NAMES = [
86
"XDG_SESSION_DESKTOP",
87
"XDG_SESSION_TYPE",
88
"WAYLAND_DISPLAY",
89
+ "SSL_CERT_FILE",
90
+ "SSL_CERT_DIR",
91
+ "NODE_EXTRA_CA_CERTS",
92
"T3CODE_TELEMETRY_ENABLED",
93
"__MISE_DIFF",
94
] as const;
@@ -454,6 +457,12 @@ const installPosixEnvironment = Effect.fn("desktop.shellEnvironment.installPosix
457
"XDG_DATA_HOME",
458
"XDG_RUNTIME_DIR",
459
"WAYLAND_DISPLAY",
460
+ // CA trust set in the shell profile. Without it, a Node or OpenSSL build
461
+ // that has no bundled roots (a shared-OpenSSL node on PATH) cannot verify
462
+ // TLS, so provider updaters and agents fail to reach their registries.
463
+ "SSL_CERT_FILE",
464
+ "SSL_CERT_DIR",
465
+ "NODE_EXTRA_CA_CERTS",
466
// The telemetry opt-out is documented as a shell variable; GUI launches never see it.
467
"T3CODE_TELEMETRY_ENABLED",
468
] as const) {