Repository navigation
Commit c6b0d99
* Trust platform and SSL_CERT_FILE roots (WIP)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Trust the OS store and SSL_CERT_FILE for HTTPS
Every HTTPS call (patch API, public proxy, blob and registry fetches,
telemetry, self-update) trusted only the bundled Mozilla roots. Behind
a TLS-inspecting corporate proxy, whose private CA no setting could
add, every request failed with UnknownIssuer.
All production reqwest clients are now built by one constructor,
utils::http::client_builder(), which adds the platform trust store to
the bundled roots. rustls-native-certs reads the macOS keychain, the
Windows store or the Linux bundle, and honors SSL_CERT_FILE and
SSL_CERT_DIR. The store is read once per process and unusable roots
are skipped. Verification is never relaxed.
Tests run a local TLS server signed by a private CA: the handshake
succeeds only when SSL_CERT_FILE names that CA. A text ratchet keeps
new reqwest::Client constructors out of production code.
Fixes #1107
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Read platform roots only on an unknown issuer
CI's scan benchmark showed 5-10 ms more CPU per run: every process
read the whole platform store (hundreds of PEM files on Linux) and
every client re-parsed those roots.
client_builder() now hands reqwest one shared rustls config, built
once per process. Its verifier checks the bundled webpki roots first
and reads the platform store (or SSL_CERT_FILE / SSL_CERT_DIR) only
after an UnknownIssuer, then once per process. Other verification
errors are returned unchanged, so trust is still the union of both
sets and verification is never relaxed. Building a client no longer
parses any roots. The load-error log line flagged by CodeQL is gone.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent bc3f920 commit c6b0d99
14 files changed
Lines changed: 545 additions & 8 deletions
File tree
- crates
- socket-patch-cli
- socket-patch-core
- src
- api
- update
- utils
- vendor
- tests/tls-ca
- docs
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1128 | 1128 | | |
1129 | 1129 | | |
1130 | 1130 | | |
1131 | | - | |
| 1131 | + | |
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1991 | 1991 | | |
1992 | 1992 | | |
1993 | 1993 | | |
1994 | | - | |
| 1994 | + | |
1995 | 1995 | | |
1996 | 1996 | | |
1997 | 1997 | | |
| |||
2008 | 2008 | | |
2009 | 2009 | | |
2010 | 2010 | | |
2011 | | - | |
| 2011 | + | |
2012 | 2012 | | |
2013 | 2013 | | |
2014 | 2014 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| |||
0 commit comments