Skip to content

[Bug]: Cloud sign-in and Orca Relay fail silently behind TLS-inspecting corporate networks #13735

Closed as not planned

Description

@Jaeyoung22

Operating system

macOS (the Node-vs-Chromium trust split is not platform specific, so Windows and Linux should behave the same)

Orca version

v1.4.178

Details

Short summary: Three separate user-visible failures — sign-in never completing, Relay pairing codes failing to mint, and Relay refusing to connect after a successful sign-in — all come from one cause. Orca's cloud requests leave on Node's network stack, which does not consult the OS trust store. On a network that terminates TLS with a corporate root CA, the browser half of every flow succeeds and the app half fails, and nothing in the UI says why.

What happened?

Behind an inline TLS-inspecting corporate VPN:

  1. Sign-in — shell.openExternal opens the browser, login succeeds there, then the app sits doing nothing until the 5-minute AUTH_TIMEOUT_MS expires. When an error does surface, the toast description reads fetch failed.
  2. Relay pairing — Couldn't create a Relay pairing code. with no reason given. Copy diagnostics yields "code": "relay_mint_failed", which is the fallback constant rather than the real error.
  3. Relay connect — signing in with the VPN off works, but turning the VPN back on makes Relay fail again. The stored token is fine; the next leg hits the same wall.

Root cause

The chain presented for relay.onorca.dev on that network (identifiers redacted):

0 s:CN=relay.onorca.dev
1 s:CN=<redacted> Forward Trust CA
2 s:CN=<redacted> Root CA

The corporate root is installed in the macOS System keychain, so Chromium — and therefore every browser step of every flow — trusts it. Node ships its own CA list and does not consult the OS store, so Orca's own requests to the same host are rejected.

$ node -e "fetch('https://relay.onorca.dev/').then(r=>console.log('OK',r.status)).catch(e=>console.log('FAIL',e.cause?.code))"
FAIL SELF_SIGNED_CERT_IN_CHAIN

$ NODE_EXTRA_CA_CERTS=~/corp-root.pem node -e "…same…"
OK 404

$ node --use-system-ca -e "…same…"
OK 404

OK 404 is the handshake succeeding; / simply has no route. So reachability and DNS are fine and this is purely a trust-store problem.

It is also not a proxy-configuration problem. The interception is transparent, so session.resolveProxy() reports DIRECT and the existing ensureElectronProxyFromEnvironment() bridge in src/main/network/proxy-settings.ts has nothing to act on. That bridge only reconfigures the Electron session in any case, which does not affect Node's global fetch.

Affected call sites

Location Transport
src/main/orca-profiles/profile-cloud-client.ts:163 token exchange, global fetch
src/main/runtime/relay/relay-http-client.ts:93 relay token exchange, input.fetch ?? globalThis.fetch (production default is Node/undici)
src/main/runtime/relay/relay-http-client.ts:126 /v1/assign, same
src/main/runtime/relay/relay-control-client.ts:72 relay control socket, ws constructed with no agent

Where the reason is lost

  • src/main/orca-profiles/profile-cloud-service.ts:90 returns error.message. For a transport failure that string is fetch failed; error.cause.code is dropped.
  • src/shared/mobile-relay-mint-failure.ts:17 keeps a code only when it matches /^relay_[a-z0-9_]{1,74}$/, so SELF_SIGNED_CERT_IN_CHAIN is discarded for the relay_mint_failed fallback. The call site at src/main/runtime/runtime-rpc.ts:881 deliberately refuses to log raw provider errors because they may carry request metadata or credentials — a reasonable constraint, but today the result is that no sanitized cause survives either.

How can we reproduce it?

  1. Join a network that performs TLS inspection with a corporate root CA (or install any MITM root and route through it).
  2. Confirm the root is trusted by the OS — the browser reaches https://relay.onorca.dev without warnings.
  3. Run the node -e snippet above → SELF_SIGNED_CERT_IN_CHAIN.
  4. In Orca, sign in to Orca Cloud → the browser reports success, the app never does.
  5. Choose Orca Relay in mobile pairing → Couldn't create a Relay pairing code.

Expected

The inconsistency is what I'd like to flag rather than any particular remedy: within one app, the built-in browser and the update path go out through Chromium and honour the OS trust store, while cloud sign-in and Relay go out through Node and do not. Whichever way that is resolved, a failure of this kind should name its cause instead of timing out silently.

Anything else that might help?

  • This may be the explanation for [Bug] Orca relay for mobile #10425 (relay can't be reached, falling back to local), which has 8 comments and no identified cause.
  • Related prior art: #521 / #800 on HTTP_PROXY, referenced at src/main/rate-limits/claude-fetcher.ts:55. Distinct problem — those are explicit proxies, this is transparent interception plus trust.
  • tls.getCACertificates('system') returns only 11 certs here and does not include the corporate root, even though the --use-system-ca flag works. A runtime tls.setDefaultCACertificates(tls.getCACertificates('system')) would therefore not be a fix on macOS.
  • Workarounds that do work today: launch with NODE_EXTRA_CA_CERTS=<corp-root.pem> (note that open -a Orca does not propagate env — the binary has to be launched directly, or launchctl setenv used), or avoid the cloud entirely by pairing over LAN with Tailscale.

On fixing it

I've opened a small PR for the diagnostics half only — preserving an allow-listed transport error code so the sign-in toast and the Relay Copy diagnostics payload name the cause. It changes no transport, TLS policy, or trust store, and makes nothing succeed that fails today.

The transport half seems like yours to direct, so I'd rather ask than guess. net.fetch would inherit Chromium's trust store and system proxy for the HTTP legs, but the ws control socket has no equivalent, and I don't know how you'd want that to interact with the SSH and remote-runtime paths. Happy to implement whichever direction you prefer — which would you like?

Activity

  1. manuaudio commented on Aug 11, 2026

    @manuaudio
    Contributor

    I reproduced your trust-store measurements on a second macOS machine with a different Node version, and they hold — more starkly than your numbers suggest. That matters because one of your findings rules out a whole fix direction, and it deserves independent confirmation before anyone relies on it. It also points at an asymmetry between your two candidate directions that I think answers your question.

    Verified against upstream/main at 680a9d9bc5; measurements on macOS, Node v24.16.0 (yours reported 11 system certs, so this is a genuinely independent sample).

    Your getCACertificates('system') finding is confirmed

    $ node -e "const tls=require('tls');for(const k of ['default','system','bundled','extra'])console.log(k,tls.getCACertificates(k).length)"
    default 145
    system 5
    bundled 145
    extra 0
    
    $ security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain | grep -c 'BEGIN CERTIFICATE'
    158

    system returns 5 here against 158 in the OS root keychain. So tls.setDefaultCACertificates(tls.getCACertificates('system')) is not a fix on macOS, exactly as you said — and the gap is not a near-miss, it's two orders of magnitude off. Worth having that on the record from a second machine, since it's the load-bearing negative in your report.

    The asymmetry between your two directions

    You flagged that net.fetch has no equivalent for the ws control socket. That's the deciding factor, and it cuts cleanly:

    Direction profile-cloud-client.ts fetch relay-http-client.ts ×2 relay-control-client.ts ws
    net.fetch (Chromium stack) fixed fixed not fixed
    tls.setDefaultCACertificates(...) fixed fixed fixed

    ws builds its TLS connection on Node's own stack, so it inherits Node's default CA set — which means changing that default reaches all four call sites in one move, while net.fetch reaches three and leaves the socket that keeps Relay connected still failing. Given your symptom #3 ("signing in with the VPN off works, but turning the VPN back on makes Relay fail again"), the control socket is not the leg you can afford to leave out.

    The third option works — measured, not theorised

    setDefaultCACertificates accepts arbitrary PEM, so the OS store can be read directly rather than via Node's deficient system accessor:

    $ node -e "
    const tls=require('tls'), {execFileSync}=require('child_process');
    const pem=execFileSync('security',['find-certificate','-a','-p','/System/Library/Keychains/SystemRootCertificates.keychain'],{encoding:'utf8',maxBuffer:64*1024*1024});
    const certs=pem.split(/(?=-----BEGIN CERTIFICATE-----)/).filter(s=>s.includes('BEGIN'));
    tls.setDefaultCACertificates(certs);
    console.log('default count:', tls.getCACertificates('default').length);
    "
    setDefaultCACertificates available: function
    parsed from keychain: 158
    default count: 158

    145 → 158, at runtime, no launch flag and no NODE_EXTRA_CA_CERTS.

    The trap in that option, which is the part I'd most want a fix to get right

    A corporate root does not live in SystemRootCertificates.keychain. That file is Apple's built-in set. Admin- and MDM-installed roots — i.e. exactly the Forward Trust CA in your chain — land in /Library/Keychains/System.keychain:

    $ security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain | grep -c 'BEGIN CERTIFICATE'
    158
    $ security find-certificate -a -p /Library/Keychains/System.keychain | grep -c 'BEGIN CERTIFICATE'
    3

    (3 on my unmanaged machine; a managed one is where your corporate root would appear.) So an implementation that reads only the first keychain would load 158 certs, look like it worked, and still fail on the one certificate that matters. Both stores have to be read — and arguably the user login keychain too. That is the kind of thing that passes review and fails in the field, so it seemed worth naming explicitly.

    Two smaller notes

    Citation drift: the ws construction is at relay-control-client.ts:73, not :72 — :72 is the ((url, token) => arrow. Your other three call sites verify exactly as written (profile-cloud-client.ts:163, relay-http-client.ts:93 and :126, both literally (input.fetch ?? globalThis.fetch)).

    There is already a seam at the socket. relay-control-client.ts:70-77 is:

    this.createSocket =
      options.createSocket ??
      ((url, token) =>
        new WebSocket(url, {
          headers: { authorization: `Bearer ${token}` },
          perMessageDeflate: false,
          maxPayload: 64 * 1024
        }))

    createSocket is injectable, and the default options object carries no agent and no ca. So if maintainers prefer a narrow per-socket fix over a process-global one, there's a place for it that doesn't require inventing an abstraction — ws passes TLS options straight through to tls.connect.

    What I did not verify

    I confirmed the CA-set manipulation and the counts on my own machine; I do not have a TLS-inspecting network, so I did not reproduce the SELF_SIGNED_CERT_IN_CHAIN failure or prove that a keychain-loaded root makes your specific handshake succeed. The ws-inherits-Node's-default-CA claim follows from ws using tls.connect rather than from a MITM test I ran. Your NODE_EXTRA_CA_CERTS result is the strong evidence there — it already demonstrates that putting the root into Node's trust set is sufficient, and setDefaultCACertificates is just a runtime route to the same place.

    Your diagnostics PR (#13736) looks orthogonal to all of this and independently worth landing — a transport failure that reports fetch failed and relay_mint_failed is unactionable regardless of which transport direction wins.

  2. AmethystLiang commented on Aug 11, 2026

    @AmethystLiang
    Contributor

    thanks for reporting. looking into it

  3. AmethystLiang commented on Aug 11, 2026

    @AmethystLiang
    Contributor

    thanks for reporting. looking into it

  4. Jinwoo-H commented on Aug 18, 2026

    @Jinwoo-H
    Contributor

    Hi — we have an experimental macOS build of the proposed TLS-trust fix available for testing:

    This build is signed and notarized, but it is unlanded and experimental. It was built from PR #15208 at commit 641fdaf3d6.

    If you can, please try it while connected to the corporate VPN/TLS-inspection network and check:

    1. Browser sign-in returns to Orca and the cloud session exchange completes.
    2. Relay pairing/mint succeeds.
    3. A cloud assignment starts and the Relay connection stays alive.

    If anything still fails, please reply with the Orca version shown in About, macOS version, which step failed, and the diagnostics/error code. Please avoid posting any company certificates or tokens.

  5. Jinwoo-H commented on Aug 26, 2026

    @Jinwoo-H
    Contributor

    We have a reworked fix in PR #16399, now rebased on latest main and green in required CI. A signed/notarized macOS ad-hoc build is being cut from the exact tested commit now.

    Could the original reporter (or anyone on a managed/corporate TLS-inspection network) try that build and report whether these four legs all work?

    1. Browser sign-in handoff / Cloud session exchange
    2. Relay token mint
    3. Relay HTTP assignment
    4. Relay control and data WebSockets

    Please include Orca version, OS version, and which leg fails (plus the error code/message if shown). Please do not send certificates, tokens, or other secrets. The build link will be added here when publishing finishes.

  6. Jinwoo-H commented on Aug 26, 2026

    @Jinwoo-H
    Contributor

    The signed/notarized ad-hoc build is published from the final PR commit 7a5b66fd33:

    Release: https://github.com/stablyai/orca-adhoc/releases/tag/v1.4.189-adhoc.20260826043417

    Downloads:

    Please test the four legs listed above on the managed/corporate network: browser sign-in handoff / Cloud session exchange, Relay mint, Relay HTTP assignment, and Relay control + data WebSockets. Tell us the Orca version, OS, and which leg fails (plus any visible error code/message). Please do not send certificates, tokens, or other secrets.

  7. added
    bug
    os:macos
    os:linux
    on Sep 19, 2026
  8. added theissue type on Sep 19, 2026
  9. nwparker commented on Oct 18, 2026

    @nwparker
    Contributor

    Closing awaiting the managed-network retest explicitly requested on August 18 and August 26. The August 26 comment provides signed test builds and asks for results for Cloud sign-in exchange, Relay mint, HTTP assignment, and control/data WebSockets, with Orca/OS versions and any failing step's error code. No results have been posted since those requests.

    This does not claim the TLS-trust fix shipped or that corporate-network support is resolved: #16399 and the related transport/diagnostics work remain separate open PRs. We can reopen this report with the requested results or a current-release reproduction. Please keep certificates and tokens private.

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

Metadata

Metadata

Assignees

Labels

browserbugos:Windowsos:linuxos:macos

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions