[Bug]: GitHub PR sync fails behind TLS-inspecting proxy since nightly 20261006.2752 #16703
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
- Use the Windows desktop app with a WSL runtime behind a corporate TLS-inspecting proxy.
- Install the proxy's root CA in the WSL system trust store and export
NODE_EXTRA_CA_CERTSin the WSL shell profile (.bashrc/.zshrc), pointing to the proxy CA certificate. - Start T3 Code normally from Windows using
0.0.46-nightly.20261006.2752. - Use a thread with an open, linked GitHub PR and automatic settlement on merge enabled.
- Merge the PR on GitHub and allow background PR synchronization to run.
- Observe that the linked PR remains
openin T3 Code and the thread does not auto-settle. The server trace repeatedly reports the TLS error below.
The same setup works with 0.0.46-nightly.20261006.2735.
Expected behavior#
GitHub PR synchronization succeeds behind the proxy using the configured trusted CA. Linked PRs update to merged, allowing otherwise eligible threads to auto-settle, as in nightly 2735.
Actual behavior#
Linked PRs remain open after merging on GitHub, preventing automatic thread settlement. Background synchronization repeatedly fails with self-signed certificate in certificate chain.
The desktop-launched WSL server does not have NODE_EXTRA_CA_CERTS in its environment, despite the variable being exported in the WSL shell profile.
A separate Node fetch test against https://api.github.com succeeds when NODE_EXTRA_CA_CERTS is supplied and fails with the certificate error when it is absent.
Likely cause
#16319 / #16320 moved GitHub PR operations from the gh CLI to in-process HTTP requests. In this environment, gh accepts the proxy CA through the OS trust store, while the new Node request path does not trust it under the desktop server's launch configuration.
This is consistent with the version regression and the controlled fetch test, but the specific introducing change has not been bisected.
Possible fixes
- Use the system certificate store for GitHub requests, for example Node's
--use-system-cawhere supported by the server runtime. - Import and forward
NODE_EXTRA_CA_CERTSwhen starting the desktop/WSL server, using #16563's telemetry environment-variable handling as a precedent. ConsiderSSL_CERT_FILEwhere applicable. - Provide a setting for additional trusted CA certificates.
Impact#
Minor bug or occasional failure
Version or commit#
0.0.46-nightly.20261006.2752
Environment#
Windows 11 desktop app with a WSL 3 runtime, behind a corporate TLS-inspecting proxy. The proxy's root CA is installed in the WSL system trust store. NODE_EXTRA_CA_CERTS is exported in the WSL shell profile (.bashrc/.zshrc).
Logs or stack traces#
PullRequestSyncReactor.sweep: pull request sync skipped
reason: Pull request operation summary failed: Could not reach GitHub at github.com.
GitHubApi.send (getPullRequestSummary, POST /graphql)
HttpClientError: Transport error (POST https://api.github.com/graphql)
TypeError: fetch failed
Error: self-signed certificate in certificate chain
Additional observation: anonymous usage-data uploads through AnalyticsService.sendBatch fail with the same certificate error on nightly 2735 as well. That failure predates this PR-sync regression.
Screenshots, recordings, or supporting files#
No response
Workaround#
Nightly 0.0.46-nightly.20261006.2735 works in the same environment.
Supplying NODE_EXTRA_CA_CERTS fixes the standalone Node fetch test, but exporting it in the WSL shell profile does not reach the desktop-launched server. A workaround for the desktop launch on nightly 2752 has not been verified.
wKovacs64(GitHub profile, opens in a new tab) added labelsbug
wKovacs64(GitHub profile, opens in a new tab) added labelsneeds-triage
juliusmarminge removed labelsneeds-triage
juliusmarminge added labelsvia-triage
Additional reproduction on macOS, affecting saved GitHub PAT verification as well as GitHub PR operations.
Environment#
- T3 Code desktop Nightly:
0.0.46-nightly.20261014.3093 - Bundled Node runtime:
24.21.0 - macOS, on a network with HTTPS inspection; the inspection CA is trusted by the OS.
Observed behavior#
After saving a GitHub PAT in Settings, verification reports:
Could not verify GitHub. Could not check the token saved in Settings: Could not reach GitHub at github.com.The server trace shows the underlying failure for
GitHubApi.sendduring discovery (GET https://api.github.com/user):GitHubApiRequestError: Could not reach GitHub at github.com. HttpClientError: Transport error (GET https://api.github.com/user) TypeError: fetch failed Error: unable to get local issuer certificateGitHub GraphQL PR requests fail with the same TLS cause. The failure occurs before GitHub can validate the PAT; this is not evidence of insufficient token permissions.
Controlled reproduction with the desktop app's bundled runtime#
These probes deliberately send no token:
ELECTRON_RUN_AS_NODE=1 "/Applications/T3 Code (Nightly).app/Contents/MacOS/T3 Code (Nightly)" \ -e 'fetch("https://api.github.com/user").then(r=>console.log("HTTP",r.status)).catch(e=>console.log(e.cause?.code,e.cause?.message))'Result:
UNABLE_TO_GET_ISSUER_CERT_LOCALLY unable to get local issuer certificateWith only system CA trust enabled:
ELECTRON_RUN_AS_NODE=1 NODE_USE_SYSTEM_CA=1 "/Applications/T3 Code (Nightly).app/Contents/MacOS/T3 Code (Nightly)" \ -e 'fetch("https://api.github.com/user").then(r=>console.log("HTTP",r.status)).catch(e=>console.log(e.cause?.code,e.cause?.message))'Result:
HTTP 401The same successful transport result occurs with
--use-system-ca. Curl also reaches that endpoint with successful TLS verification. The 401 is expected for an unauthenticated/userrequest and confirms that TLS succeeds; it does not validate the saved PAT.Workaround and scope#
Launching T3 with
NODE_USE_SYSTEM_CA=1is a suggested workaround based on the successful bundled-runtime probe. End-to-end saved-PAT verification after restarting the full desktop app has not yet been confirmed.This provides macOS evidence for the same trust-store mismatch tracked here. Please consider system CA support for the desktop backend and a certificate-specific error/hint in GitHub Settings instead of the generic “Could not reach GitHub” message. TLS verification remained enabled throughout these tests.
This report intentionally omits certificate identities, organization/proxy names, usernames, private hostnames, credentials, screenshots, and raw logs.
- T3 Code desktop Nightly:
I have a small fix ready for the "use the system trust store when the runtime supports it" direction and would like a yes/no before opening a PR, since #18128 treats trusting the OS store by default as a feature.
Branch: https://github.com/JustYannicc/t3code/tree/fix/server-system-ca (387dc8d)
Approach. In
apps/server/src/bin.ts, before the CLI loads, the server callstls.setDefaultCACertificates([...tls.getCACertificates("default"), ...tls.getCACertificates("system")]). That is the same OS store--use-system-ca/NODE_USE_SYSTEM_CA=1reads, but it is added to the existing defaults, so the bundled Mozilla roots and anything fromNODE_EXTRA_CA_CERTSstay trusted. Node versions withoutsetDefaultCACertificates(the server's engines allow 22.16, it landed in 22.19 / 24.5), or an empty or unreadable OS store, keep Node's defaults. Because it runs inbin.ts, it coversnpx t3, the service, the desktop's local and WSL backends (apps/server/dist/bin.mjs), and the single-executable build, with nobody having to set env vars. The ACP bridge fast path is skipped since it only talks to the local server. Reading the OS store took about 17 ms on macOS.Repro (Docker,
node:24-bookworm): a throwaway CA installed only in the container's OS store, a second one passed only throughNODE_EXTRA_CA_CERTS, and a local HTTPS server for each that sends leaf + root like an inspecting proxy.374-repro.sh
#!/usr/bin/env bash # Repro for pingdotgg/t3code#16703: Node's fetch rejects a CA the OS trusts, # until the server adds the OS store to its default CAs at startup. # # Usage: ./374-repro.sh [path/to/apps/server/src/systemCertificates.ts] # Without an argument it downloads the module from the branch. Needs Docker. set -euo pipefail MODULE_URL="https://raw.githubusercontent.com/JustYannicc/t3code/387dc8d98eba2556af9c2a16a28daad2d6c32d2b/apps/server/src/systemCertificates.ts" work="$(mktemp -d)" trap 'rm -rf "$work"' EXIT if [ -n "${1:-}" ]; then cp "$1" "$work/systemCertificates.ts" else curl -fsSL "$MODULE_URL" -o "$work/systemCertificates.ts" fi cat > "$work/inside.sh" <<'INSIDE' set -euo pipefail cd "$(mktemp -d)" echo "node $(node --version)" # Two throwaway CAs, each signing a localhost cert. The servers send leaf + root, # like a TLS-inspecting proxy does: # os-ca -> installed in the OS store only (https://localhost:8443) # extra-ca -> passed via NODE_EXTRA_CA_CERTS only (https://localhost:8444) make_ca() { openssl req -x509 -newkey rsa:2048 -nodes -days 1 -subj "/CN=Throwaway $1" \ -addext "basicConstraints=critical,CA:TRUE" -addext "keyUsage=critical,keyCertSign" \ -keyout "$1.key" -out "$1.crt" 2>/dev/null openssl req -newkey rsa:2048 -nodes -subj "/CN=localhost" -keyout "$1-leaf.key" -out "$1-leaf.csr" 2>/dev/null printf 'subjectAltName=DNS:localhost\n' > san.ext openssl x509 -req -in "$1-leaf.csr" -CA "$1.crt" -CAkey "$1.key" -CAcreateserial -days 1 \ -extfile san.ext -out "$1-leaf.crt" 2>/dev/null } make_ca os-ca make_ca extra-ca cp os-ca.crt /usr/local/share/ca-certificates/throwaway-os-ca.crt update-ca-certificates >/dev/null 2>&1 cat > server.mjs <<'JS' import https from "node:https"; import fs from "node:fs"; for (const [name, port] of [["os-ca", 8443], ["extra-ca", 8444]]) { https.createServer({ key: fs.readFileSync(`${name}-leaf.key`), cert: fs.readFileSync(`${name}-leaf.crt`) + fs.readFileSync(`${name}.crt`) }, (_req, res) => res.end("ok\n")).listen(port); } console.log("listening"); JS node server.mjs > server.log & until grep -q listening server.log; do sleep 0.1; done sleep 0.2 echo "--- curl, OS store" curl -sS https://localhost:8443/ cat > probe.mjs <<'JS' import tls from "node:tls"; import { X509Certificate } from "node:crypto"; if (process.argv[2] === "after") { const { trustSystemCertificates } = await import("/repro/systemCertificates.ts"); console.log(`trustSystemCertificates() -> ${trustSystemCertificates()}`); } const fingerprints = (type) => new Set(tls.getCACertificates(type).map((pem) => new X509Certificate(pem).fingerprint256)); const defaults = fingerprints("default"); const kept = (type) => [...fingerprints(type)].every((fp) => defaults.has(fp)); console.log(`default CAs: ${defaults.size}, all bundled kept: ${kept("bundled")}, NODE_EXTRA_CA_CERTS kept: ${kept("extra")}`); for (const [label, url] of [["OS-trusted CA ", "https://localhost:8443/"], ["NODE_EXTRA CA ", "https://localhost:8444/"]]) { try { const res = await fetch(url); console.log(`fetch ${label} HTTP ${res.status}`); } catch (error) { console.log(`fetch ${label} ${error.cause?.code}`); } } JS export NODE_EXTRA_CA_CERTS="$PWD/extra-ca.crt" echo "--- node fetch, Node defaults (before)" node probe.mjs before echo "--- node fetch, trustSystemCertificates() at startup (after)" node probe.mjs after INSIDE docker run --rm -v "$work:/repro:ro" node:24-bookworm bash /repro/inside.shOutput:
node v24.22.0 --- curl, OS store ok --- node fetch, Node defaults (before) default CAs: 122, all bundled kept: true, NODE_EXTRA_CA_CERTS kept: true fetch OS-trusted CA SELF_SIGNED_CERT_IN_CHAIN fetch NODE_EXTRA CA HTTP 200 --- node fetch, trustSystemCertificates() at startup (after) trustSystemCertificates() -> true default CAs: 162, all bundled kept: true, NODE_EXTRA_CA_CERTS kept: true fetch OS-trusted CA HTTP 200 fetch NODE_EXTRA CA HTTP 200Current main already forwards
NODE_EXTRA_CA_CERTSfrom the login shell (#19604), which helps when the CA is exported there; this covers the case where the CA only lives in the OS store.Before, Node's
fetchfails the OS-trusted CA with the sameself-signed certificate in certificate chainreported here while curl accepts it. After, both CAs work and every bundled andNODE_EXTRA_CA_CERTSroot is still in the default set (checked by fingerprint). Onnode:22.16the call returnsfalseand leaves the defaults alone.Is trusting the OS store by default, in addition to the bundled roots, acceptable to you? If you'd rather make it opt-in (a setting or an env var) or only forward
NODE_USE_SYSTEM_CAfrom desktop, say so and I'll change the branch before opening anything.Written by Claude Opus 5.5 (Claude Code) on behalf of @JustYannicc.
I refreshed the candidate from the current upstream main and pushed a runnable demo branch. Trusting OS roots by default changes product behavior, so this remains a proposal until the direction is approved.
- Branch: https://github.com/JustYannicc/t3code/tree/proposal/server-system-ca-20261018
- Base:
9c161462c94f7d9d6d9169da5c841457cbadf213 - Candidate: https://github.com/JustYannicc/t3code/commit/9c815e60a85c114e0748bcf045acd1a808f08ab3
- Docker repro script
The script creates two throwaway CAs inside an ephemeral Node 24.22 container. It installs one in that container's OS store and supplies the other through
NODE_EXTRA_CA_CERTS. It does not change the host trust store.Observed output:
curl using OS trust: ok before: OS-trusted CA SELF_SIGNED_CERT_IN_CHAIN before: NODE_EXTRA_CA_CERTS CA HTTP 200 after: trustSystemCertificates() -> true after: OS-trusted CA HTTP 200 after: NODE_EXTRA_CA_CERTS CA HTTP 200 bundled roots kept: true NODE_EXTRA_CA_CERTS roots kept: trueThe six focused tests pass. They cover additive trust, a missing setter, an empty OS store, and read or write failures. The server package typecheck, targeted lint, and formatting checks also pass.
Current main forwards explicit CA file variables from the desktop login shell. This candidate covers the separate case where a CA exists only in the OS trust store.
Would trusting the OS store by default be acceptable for this report?
juliusmarminge added labelsneeds more info
juliusmarminge removed labelsneeds more info
Another reproduction, from a consumer setup rather than a corporate proxy: NordVPN's Threat Protection on macOS. It re-signs HTTPS for some hosts with a local "NordVPN Threat Protection" root that it installs in the System keychain. This shows that OS-trusted inspection CAs are not limited to managed corporate machines.
Environment#
- macOS arm64, T3 Code Nightly
0.1.7-nightly.20261101.4035(Electron 44.10.0, bundled Node 24.22.1) - NordVPN with Threat Protection enabled. No
NODE_EXTRA_CA_CERTSor proxy variables are set.
Symptom#
Usage → Limits shows no Antigravity rows. The provider cache contains only
unavailable: { reason: "probeFailed", message: "Could not read Antigravity limits. Refresh provider status to retry." }. The trace does not record the cause, because the probe's finalEffect.catchinantigravityUsageLimits.tsdrops it. Antigravity turns themselves still work, because the ACP binary uses the OS trust store.What the bundled runtime sees#
The interception depends on the host. In my case it re-signs Google endpoints but not
api.github.com:Host Bundled runtime Bundled + NODE_USE_SYSTEM_CA=1System Node 26 oauth2.googleapis.comUNABLE_TO_VERIFY_LEAF_SIGNATUREOK OK daily-cloudcode-pa.googleapis.comUNABLE_TO_VERIFY_LEAF_SIGNATUREOK OK api.github.com200 200 200 With
rejectUnauthorized: false, the bundled runtime receives the chainupload.video.google.com <- NordVPN Threat Protection. In the same test, the system Node got the genuineWE2 <- GTS Root R4chain.NODE_OPTIONS=--use-system-cahas no effect on the bundled runtime, butNODE_USE_SYSTEM_CA=1works.Checks#
- I ran
makeAntigravityUsageProbefrom currentmain, unmodified, withFetchHttpClient.layerunder system Node against the same account. It returns all five quota windows (gemini-5h,gemini-weekly,gemini-argon-wtu-weekly,3p-5h,3p-weekly). So the only failing piece is TLS trust in the bundled runtime. - Under the bundled runtime, the call proposed above,
tls.setDefaultCACertificates([...tls.getCACertificates("default"), ...tls.getCACertificates("system")]), fixes it: both Google hosts go fromUNABLE_TO_VERIFY_LEAF_SIGNATUREto a normal HTTP response, andapi.github.comkeeps working. I tested that call directly. I did not build the proposal branch.
#23408 shows the same bundled-runtime
UNABLE_TO_VERIFY_LEAF_SIGNATUREon macOS, so it may be another case of a local security product doing this.Current workaround: run
launchctl setenv NODE_USE_SYSTEM_CA 1, then fully quit and reopen T3 Code. This is not yet verified on the running app.- macOS arm64, T3 Code Nightly
Harry1620(GitHub profile, opens in a new tab) linked this to #31067
Another reproduction on macOS with a corporate TLS-inspecting proxy (Netskope), T3 Code 0.1.8 from the Homebrew cask.
- Every in-process GitHub call failed: 85 of 85
gitHubGraphQlClient.capResponsespans inserver.trace.ndjsonended inTypeError: fetch failedwithself-signed certificate in certificate chain(Socket.onConnectSecure). Linking and reading PRs didn't work. ghandcurlon the same machine reachapi.github.comfine, because the proxy's root CA is in the System keychain and they use it. Only T3's bundled Node rejects the chain.- Workaround: put the proxy's root and intermediate CAs in one PEM file, run
launchctl setenv NODE_EXTRA_CA_CERTS <path>, then quit and reopen T3. After that every GitHub call succeeded; the only non-200 was the expected 404 fromisRepositoryStarred.
+1 for trusting the OS store by default, or at least showing the TLS cause in the UI. Right now the only sign is the server trace.
- Every in-process GitHub call failed: 85 of 85
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Thanks for the careful regression report — the nightly window and stack trace line up with a real change on main.
What we verified
0.0.46-nightly.20261006.2735and…2752, main picked up the GitHub API stack (#16319 transport, #16320 PR layer, plus #16321/#16322). PR sync now goes through in-processGitHubApi.send→ EffectFetchHttpClient(Nodefetch) instead of shelling out togh. That matches theGitHubApi.send (getPullRequestSummary, POST /graphql)/self-signed certificate in certificate chainfailure you are seeing onPullRequestSyncReactor.sweep.LOGIN_SHELL_ENV_NAMESinDesktopShellEnvironment.ts) and only forwards a separate allowlist into WSL (WSL_FORWARDED_ENV_NAMESinDesktopBackendConfiguration.ts). Both includeT3CODE_TELEMETRY_ENABLEDafter #16563, but neither includesNODE_EXTRA_CA_CERTS/SSL_CERT_FILE. So a CA path exported in.bashrc/.zshrcnever reaches the desktop-launched WSL server — consistent with your observation and with analytics already failing the same way on 2735 (Nodefetchpath never trusted the proxy CA;ghdid via the OS store).service.envmerge for the background service launcher — Linux service path, not the Windows→WSL desktop spawn).Likely fix direction (not committed yet): forward
NODE_EXTRA_CA_CERTS(and possiblySSL_CERT_FILE/NODE_OPTIONSfor--use-system-ca) the same way #16563 did for telemetry, and/or teach the GitHub HTTP client to use the system trust store when the runtime supports it. A dedicated “extra trusted CAs” setting is a longer-term option.Leaving this open as a confirmed regression for Windows desktop + WSL behind TLS-inspecting proxies since the in-process GitHub client landed. Triage labels:
bug,via-triage.