Repository navigation
Trust the platform's certificate store for HTTPS - #83
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
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
curlon the same machine worked. The reported symptom wasgrida fx init --templatefailing to download its archive from codeload.github.com; live provider calls go through the same transport and would fail the same way.Change
reqwestnow enablesrustls-tls-webpki-rootsandrustls-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, orSSL_CERT_FILE/SSL_CERT_DIRin its place when set.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
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 --jsondownloaded 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.