Skip to content

Trust the platform's certificate store for HTTPS - #83

Merged
softmarshmallow merged 1 commit into
mainfrom
trust-platform-roots
Oct 13, 2026
Merged

softmarshmallow merged 1 commit into
mainfrom
trust-platform-roots

Conversation

@softmarshmallow

Copy link
Copy Markdown
Member

The engine's HTTPS transport trusted only the Mozilla roots bundled into the binary and never read the roots the operating system trusts. On a machine whose network re-signs HTTPS under a root its owner installed, every engine request failed at the TLS handshake, while browsers and curl on the same machine worked. The reported symptom was grida fx init --template failing to download its archive from codeload.github.com; live provider calls go through the same transport and would fail the same way.

Change

  • reqwest now enables rustls-tls-webpki-roots and rustls-tls-native-roots, so a certificate is accepted when it chains to the bundled roots or to the platform's store: the macOS keychain, the Windows store, the system bundle elsewhere, or SSL_CERT_FILE / SSL_CERT_DIR in its place when set.
  • Still rustls on every platform. The Linux engines link no OpenSSL, so the zigbuild glibc 2.28 builds are unchanged.
  • spec/providers.md §2 gains item 10 on trusted roots, and item 9 notes that a proxy whose certificates the platform trusts can read a tunnelled request.

New lockfile entries: rustls-native-certs, openssl-probe, security-framework (+-sys), core-foundation, schannel.

What users see

  • A machine whose store holds nothing beyond public roots validates exactly as before.
  • A machine that trusts an extra root (its owner's or its network's) now works the way its browser does.
  • A container image without a system bundle still has the bundled roots.

Verification

Tests never construct the real transport (spec/providers.md §2), so CI cannot exercise this. Checked by hand on macOS:

  • grida-fx init init-check --template hello --json downloaded and unpacked the release archive ("source":"release", exit 0).
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test --workspace, tools/check_spec.py: pass.

The default transport trusted only the Mozilla roots bundled into the
engine and never read the roots the operating system trusts. On a machine
whose network re-signs HTTPS under a root its owner installed, every
engine request failed at the TLS handshake while browsers and curl on
the same machine worked: init --template could not download its archive,
and live provider calls would fail the same way.

The transport now trusts the bundled roots and the platform's certificate
store together: the macOS keychain, the Windows store, the system bundle
elsewhere, or SSL_CERT_FILE / SSL_CERT_DIR in its place when set. Machines
whose store holds nothing extra validate exactly as before, and an image
without a system bundle still has the bundled roots. Still rustls on
every platform, so the Linux engines link no OpenSSL.

spec/providers.md section 2 gains item 10 on trusted roots, and item 9
notes that a proxy the platform trusts can read a tunnelled request.
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fx Ready Ready Preview Oct 13, 2026 3:48pm UTC

Request Review

@softmarshmallow
softmarshmallow merged commit ff9371d into main Oct 13, 2026
13 checks passed

This branch was successfully deployed

1 active deployment
Preview — f429a3ea Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant