You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(http): centralize HTTP client with proxy and custom-CA support (#1686)
Track B of
[voidzero-dev/setup-vp#73](voidzero-dev/setup-vp#73)
— makes `vp` work through Socket Firewall Free (sfw) and other
TLS-intercepting proxies.
## What
- **New `vite_shared::shared_http_client()`**: process-wide
`reqwest::Client` that honors `HTTPS_PROXY` / `HTTP_PROXY` / `NO_PROXY`,
picks up macOS System Settings / Windows registry proxies
(`system-proxy` feature), loads custom CAs from `SSL_CERT_FILE` and
`NODE_EXTRA_CA_CERTS` (additive, Node-style), and has connect + request
timeouts. `VP_INSECURE_TLS` (truthy only — `1`/`true`/`yes`/`on`) is a
diagnostic escape hatch with a loud warning.
- **All `reqwest::get` / `reqwest::Client::new()` call sites** in
`vite_install` and `vite_js_runtime` routed through the shared client.
- **`vite_shared::format_error_chain`**: walks `Error::source()` so
users see `... invalid peer certificate: UnknownIssuer` instead of the
opaque `error sending request for url`. Wired into both `Error::Reqwest`
variants and the four `DownloadFailed { reason }` sites.
- **New `install-e2e-test-sfw` CI job** (Linux / macOS / Windows):
downloads upstream `sfw`, runs `sfw vp i -g pnpm@…` + `sfw vp install`
against a fresh `vitejs/vite` clone. Gated on the `test: sfw` label for
PRs; unconditional on push-to-main. `VP_INSECURE_TLS=1` is scoped to the
Linux entry only (workaround for
[SocketDev/sfw-free#30](SocketDev/sfw-free#30)
/ [#43](SocketDev/sfw-free#43) —
present-but-empty EKU rejected by rustls).
## Out of scope / follow-ups
- Switch to `rustls-native-certs` so OS-installed CAs work without env
vars — Track B step 5, separate PR.
- Drop `vp_insecure_tls` from the Linux matrix once SocketDev/sfw-free
ships the EKU fix (one-line change).
Refs voidzero-dev/setup-vp#73
0 commit comments