Repository navigation
fix(net): every HTTPS request and wss socket trusts the system certificate store's roots - #1124
Merged
Merged
Conversation
…he operating system does The app's own requests (update check and download, server requests and event stream, pairing, plugin requests, web pictures, Hex, the office font) used ureq's default root list, the Mozilla roots compiled into the binary, and the MCP and terminal WebSockets used tungstenite's. Behind a network that inspects TLS with a company root in the system store, all of those failed as an unknown issuer, while the browser engine download (already on the platform verifier) and the official desktop app (Chromium) worked. A new crate, net-trust, gives every ureq agent the platform verifier and the WebSockets a rustls configuration with it; a guardrail fails any agent or socket built without it.
…efuses the update server The update check is the one path a mistake cannot be fixed forward on: a build that cannot verify its feed can never fetch the build that repairs it. When the operating system's certificate check refuses the feed or the download (or the handshake fails), the updater tries once more with the Mozilla roots compiled into the app, the list every earlier build used, so it never fails where the build before it passed.
This was referenced Nov 25, 2026
Closed
… online revocation Instead of the platform verifier, every HTTPS agent and wss socket verifies with webpki against the union of the Mozilla roots compiled into the app (webpki-root-certs) and the roots in the operating system's store (rustls-native-certs). It refuses nothing the compiled-in list accepts, trusts a company root installed in the store, and fetches no revocation online, so no first connection waits on a revocation server a network drops (the Windows verifier's 10 s accumulated timeout). The store is read once per process on the first https agent or socket: agents of a plain http:// base (the local server, Hex) read nothing, and the server's shared agent is made on its first request instead of in Server::new. The updater keeps its fallback to the compiled-in list.
Hona
marked this pull request as ready for review
November 27, 2026 01:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every HTTPS request and
wss://socket of the app trusts the roots in the operating system's certificate store as well as the compiled-in list, as the official desktop app (Chromium) does. The updater keeps the compiled-in list alone as a fallback.Problem
Behind a network that inspects TLS with its own root installed in the system certificate store (common on company PCs), most of the app's own requests fail with an unknown-issuer error:
The cause is ureq's default:
TlsConfig::default()usesRootCerts::WebPki, the Mozilla list compiled into the binary (ureq 3.5.0src/tls/mod.rs:369-375). The WebSockets use tungstenite'srustls-tls-webpki-roots, the same compiled-in list.The pane's pages, the official app's page and its updater go through Chromium, which uses the system store.
Change
New crate
net-trust: one root set for the process, the compiled-in roots (webpki-root-certs) plus the system store's (rustls-native-certs), checked by webpki.agent_config(): a ureq agent configuration withRootCerts::Specificof that set.agent_config_for(base): the same, except a plainhttp://base (the local server) gets no TLS settings, so it never reads the store.tls_config(): the TLS settings on their own.rustls_client_config(): a rustls configuration with the same roots, made once, for a socket's own TLS.builtin_agent_config()andis_certificate_refusal(): the updater's fallback.wasm32, the agent configurations are the browser shim's, since the browser checks certificates itself.The store is read once per process, on first use, off the launch path: a
OnceLockfilled the first time a TLS configuration is made. The server client builds its agent lazily (Server::agent()), so a launch against the local server reads no store. The app logsnet-trust: read N roots from the system store in X us.No online revocation: webpki checks the chain, names and validity time only. Nothing fetches OCSP or CRLs, so no handshake can wait on a revocation server that a network drops.
Every ureq agent starts from
net_trust: 23 call sites in 18 files (including sidecar probe and PTY handoff viaagent_config_for).All three WebSockets use
client_tls_with_configwith the shared rustls configuration forwss://: the MCP client inopencode-kit, the browser stream tunnel client inopencode-kit, and the persistent terminal, which had usedtungstenite::connect. Aws://socket builds no TLS configuration.The updater's fallback: when the update feed or the download is refused in the TLS handshake, the updater tries once more with the compiled-in list alone, which every earlier build used (
features/updater/src/engine.rs,call).New guardrail
scripts/guardrails/net-trust.mjs: fails any of these outsidecrates/net-trust, the browser shim and a build script:Agent::config_builder()andAgent::new_with_*;ureq::get(...)and the like);RootCerts;tungstenite::connectandclient_tls, orclient_tls_with_configwithout the shared configuration.On
devbefore this change it lists 25+ lines; on this branch, 0.What does not change
Testing
Windows, this PR's build at
fb7c95c36againstdev-488(and repeated at865803662on the newer Rune pin: 49/49 public HTTPS accepted, 0/82 throwaway root accepted, 0.3 ms median verify, 6.1-9.8 ms store read for 73 roots), touching no certificate store or proxy setting. The app process alone was given a local proxy, which relays each connection and times the client's side of each handshake:dev-488--server https://www.example.com, the release server)www.example.comLinux, this PR's build at
fb7c95c36againstdev-488, in a disposable VM whose own CA bundle (/etc/ssl/certs/ca-certificates.crt) took a throwaway root, against a local HTTPS server with a certificate from that root:dev-488Server::reachable), whichdev-488makes as well.web-clock.tspassed on head4bc958289f.Not run yet:
wss://socket (by reading, it takes the same roots),SSL_CERT_FILE/SSL_CERT_DIR, other distributions' bundle paths, arm64.Fixes #1290