Skip to content

HTML preview browser rejects HTTPS behind TLS-inspecting proxies because it ignores the system CA store #30793

Open

Description

@Amunak

What happened

On a Linux host behind a TLS-inspecting corporate network, pages rendered with html_render / html_preview can't load external HTTPS resources, such as Mermaid from cdn.jsdelivr.net. The corporate root CA is in the system store, so curl and Node succeed against the same URLs. The server's headless Chrome rejects them with net::ERR_CERT_AUTHORITY_INVALID. The agent only sees that the preview had problems, not why.

Diagnosis

  • On Linux, Chrome doesn't read /etc/ssl/certs. It trusts its built-in root store plus the user NSS database in ~/.pki/nssdb. A typical WSL or server host has no NSS database, so roots added with update-ca-certificates never reach the preview browser.
  • t3 browser setup installs libraries, fonts and an AppArmor profile, but doesn't handle CA trust. The failure has no setup hint, unlike missing libraries.
  • Related: htmlRender/publicProxy.ts always connects upstream directly with NodeNet.connect and ignores HTTPS_PROXY / HTTP_PROXY. On networks that need an explicit proxy, preview pages can't reach external resources at all. Chrome is pinned to that proxy with --proxy-server=socks5://127.0.0.1:<port> (headlessChrome.ts), so Chrome's own proxy settings don't help.
  • Possible directions: import the system CA bundle into a T3-managed NSS database for the preview profile (or have t3 browser setup offer to), and let the preview proxy chain through HTTPS_PROXY.

Steps to reproduce

  1. Use a Linux host (seen on Ubuntu 24.04 under WSL2) whose outbound HTTPS is re-signed by a corporate root CA. Install that CA only in the system store (/usr/local/share/ca-certificates + update-ca-certificates), with no ~/.pki/nssdb.
  2. Confirm that curl https://cdn.jsdelivr.net/npm/mermaid@11/package.json returns 200.
  3. Run the preview browser T3 installed: ~/.t3/tools/chrome-headless-shell/linux64/156.0.8078.70/chrome-headless-shell --disable-gpu --dump-dom https://cdn.jsdelivr.net/npm/mermaid@11/package.json
  4. It fails with net::ERR_CERT_AUTHORITY_INVALID.
  5. In T3, have an agent call html_render with a page that loads https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs. The diagram doesn't render.

Version

T3 server 0.1.6 (the triage CLI is also 0.1.6). The code is unchanged on main as of 2026-11-04.

Environment

T3 desktop app running natively on Windows. All agents and the T3 server backend run in WSL2 (Ubuntu 24.04.5 LTS, kernel 6.6.87.2, x64, Node v26.12.1), using the runtime the desktop app unpacks into ~/.t3/wsl-runtime. Server 0.1.6. The preview browser is chrome-headless-shell 156.0.8078.70 inside WSL. TLS-inspecting corporate network with no explicit proxy variables set. The corporate root CA is trusted by Windows and by the WSL system store, but not by the WSL Chrome's NSS store.

Evidence

ERROR:net/cert/internal/cert_issuer_source_aia.cc:135] AiaRequest::OnFetchCompleted got error -301
ERROR:net/socket/ssl_client_socket_impl.cc:949] handshake failed; returned -1, SSL error code 1, net_error -202
ERROR:components/headless/command_handler/headless_command_handler.cc:403] Page load failed: net::ERR_CERT_AUTHORITY_INVALID

The intercepted certificate chain is leaf -> corporate intermediate -> corporate root. Only the root is in the system store.

Related issues

#30236 (same preview proxy rejects fake-IP DNS), #18555 (browser tools don't say why a page failed to load), #24542 (preview browser trust handling), #23424 (desktop backend uses system CAs), #16703, #16435, #21922 (other TLS-inspection and proxy failures).

Fix applied or workaround

Verified fix: create a user NSS database and import the corporate root into it. After this, the step 3 command loads the page and HTML previews render CDN resources.

sudo apt-get install -y --no-install-recommends libnss3-tools
mkdir -p ~/.pki/nssdb
certutil -d sql:$HOME/.pki/nssdb -N --empty-password
certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n "Corporate Root CA" -i /usr/local/share/ca-certificates/<corporate-root>.crt

Filed by

Claude Code (Opus 5.5, claude-opus-5-5) via t3 triage.

Activity

  1. added
    via-triage
    on Nov 4, 2026
  2. vstratful commented on Nov 23, 2026

    @vstratful

    Same root cause here, with a different trigger: the in-app browser's own tabs, not just html_render.

    Setup: T3 Code Desktop 0.1.11 on Windows 11, WSL-only mode (Ubuntu), WSL server 0.1.11, networkingMode=mirrored. Local Next.js dev servers use mkcert certificates (next dev --experimental-https).

    What happened: Every https://localhost:<port> page failed in the browser pane with a certificate error, and there was no way to continue.

    Why:

    1. In WSL-only mode the WSL server is the primary environment. Its tabs run in the server's headless Chrome (preview_list reports runtime: "server", headless: true), not in the desktop's Electron browser. The WSL backend isn't given the desktop browser channel (no desktopBrowserFd in the WSL bootstrap in DesktopBackendConfiguration.ts).
    2. On Linux, Chrome only trusts ~/.pki/nssdb. The mkcert CA was in /usr/local/share/ca-certificates, and the NSS database was empty: libnss3-tools wasn't installed, so mkcert -install never added the CA to NSS.
    3. The Trust and Remember prompt from [Bug]: Desktop browser cannot approve local HTTPS certificates #17965 only covers the desktop's own browser sessions. Server-side tabs have no certificate override at all.

    Verified fix (user side):

    sudo apt-get install -y libnss3-tools
    certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n "mkcert development CA" -i <path-to-mkcert-rootCA.crt>

    Then fully restart T3. Afterwards T3's chrome-headless-shell (157.0.8103.78) loaded the mkcert-signed https://localhost page. In a control run with HOME pointed at an empty folder, the same load failed. After the restart, a real server-side tab loaded https://localhost:3000 normally.

    Suggestions:

    1. t3 browser setup, or the cert error page, could point at the NSS database, or import /usr/local/share/ca-certificates into a T3-managed NSS database.
    2. Server-side tabs could offer the same Trust and Remember override that desktop tabs got in [Bug]: Desktop browser cannot approve local HTTPS certificates #17965.
    3. Docs: remote-access.md says "The desktop app shows its own environment's tabs directly", which isn't true in WSL-only mode. The Forwarded ports palette item is also hidden under mirrored networking (correctly, since the loopback is shared), but the docs don't say so. That sent this user looking for a port-forward fix that couldn't apply.

    Investigated by Claude Opus 5.5 (Claude Code) via T3 Code triage.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions