fix(http): fall back to bundled Mozilla roots when the system CA store is empty - #2295
Conversation
Native binary sizes (
|
| Artifact | Format | Base | PR | Change |
|---|---|---|---|---|
vp (Linux x64) |
Binary | 10.38 MiB | 10.51 MiB | +132.02 KiB (+1.24%) |
vp (Linux x64) |
gzip -9 | 4.45 MiB | 4.55 MiB | +98.23 KiB (+2.15%) |
| NAPI (Linux x64) | Binary | 33.48 MiB | 33.60 MiB | +128.06 KiB (+0.37%) |
| NAPI (Linux x64) | gzip -9 | 12.93 MiB | 13.02 MiB | +97.95 KiB (+0.74%) |
vp (macOS ARM64) |
Binary | 7.70 MiB | 7.83 MiB | +129.02 KiB (+1.64%) |
vp (macOS ARM64) |
gzip -9 | 3.86 MiB | 3.95 MiB | +96.28 KiB (+2.44%) |
| NAPI (macOS ARM64) | Binary | 40.79 MiB | 40.92 MiB | +129.00 KiB (+0.31%) |
| NAPI (macOS ARM64) | gzip -9 | 17.15 MiB | 17.24 MiB | +93.31 KiB (+0.53%) |
vp (Windows x64) |
Binary | 8.42 MiB | 8.42 MiB | +512 B (+0.01%) |
vp (Windows x64) |
gzip -9 | 3.66 MiB | 3.66 MiB | +223 B (+0.01%) |
| NAPI (Windows x64) | Binary | 27.76 MiB | 27.76 MiB | 0 B (0.00%) |
| NAPI (Windows x64) | gzip -9 | 10.86 MiB | 10.86 MiB | +289 B (+0.00%) |
| Trampoline (Windows x64) | Binary | 203.00 KiB | 203.00 KiB | 0 B (0.00%) |
| Trampoline (Windows x64) | gzip -9 | 97.91 KiB | 97.91 KiB | -1 B (-0.00%) |
| Installer (Windows x64) | Binary | 4.47 MiB | 4.47 MiB | +512 B (+0.01%) |
| Installer (Windows x64) | gzip -9 | 2.09 MiB | 2.09 MiB | +164 B (+0.01%) |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Registry bridge build (
|
| Package | Version |
|---|---|
vite-plus |
0.0.0-commit.175538b184911b9af6584b86bb2a9a7079b1ae25 |
@voidzero-dev/vite-plus-core |
0.0.0-commit.175538b184911b9af6584b86bb2a9a7079b1ae25 |
Install the Vite+ CLI built from this commit, then migrate a project:
# macOS / Linux
curl -fsSL https://vite.plus | VP_PR_VERSION=2295 bash# Windows (PowerShell)
$env:VP_PR_VERSION="2295"; irm https://vite.plus/ps1 | iexAfter installing, upgrade the current project's vite-plus to this test build with:
vp migrateOr point your package manager at the bridge registry https://registry-bridge.viteplus.dev/:
| Package manager | Registry config |
|---|---|
| npm / pnpm / Bun | .npmrc: registry=https://registry-bridge.viteplus.dev/ |
| Yarn (v2+) | .yarnrc.yml: npmRegistryServer: "https://registry-bridge.viteplus.dev/" |
Then pin the build (vite aliases to vite-plus-core; pnpm can use a catalog, npm an overrides entry):
{
"devDependencies": {
"vite-plus": "0.0.0-commit.175538b184911b9af6584b86bb2a9a7079b1ae25",
"vite": "npm:@voidzero-dev/vite-plus-core@0.0.0-commit.175538b184911b9af6584b86bb2a9a7079b1ae25"
}
}
🐳 Docker preview imageBuilt from this PR's registry bridge build:
# remove any stale local copy from a previous run, then pull fresh
docker rmi ghcr.io/voidzero-dev/vite-plus:pr-2295 2>/dev/null; docker pull ghcr.io/voidzero-dev/vite-plus:pr-2295Quick check: docker run --rm ghcr.io/voidzero-dev/vite-plus:pr-2295 vp --versionSee docs/guide/docker.md for usage. |
c78a484 to
6e68170
Compare
✅ Deploy Preview for viteplus-preview canceled.
|
|
✅ Staging deployment successful! Preview: https://viteplus-staging.void.app/ |
|
Verified the registry-bridge build (
|
…e is empty When the shared HTTP client cannot be built because the trust store is empty (Debian slim and distroless images ship no ca-certificates package), retry once with the webpki-root-certs Mozilla list merged in, like Node's own bundled roots. A populated system store keeps sole authority; failures the bundle cannot fix still surface the original error. Windows keeps native-tls/SChannel and skips the fallback. Closes #2278
On Windows native-tls rejects the invalid-DER PEM at parse time, so the bad bundle is skipped with a warning, the build succeeds against SChannel, and the is_err assertion fails. The bundled-roots retry the test guards is compiled out on Windows anyway.
Regression test for the #2278 fallback: build the global vp inside a bookworm container so its glibc floor matches the runtime image, then run vp env list-remote in node:24-bookworm-slim, which ships no ca-certificates package. The job asserts the CA bundle is really absent so the check keeps guarding if the base image changes.
Both build-failure tests carried the same temp PEM write, env set/unset, and cleanup scaffold; with_invalid_ssl_cert_file now owns it.
Mount the host rustup home so the container picks up the pinned nightly that setup-rust installed instead of downloading it on every run; rustup show still installs it if the mount misses.
6e68170 to
b0682df
Compare
When the shared HTTP client cannot be built because the trust store is
empty (Debian slim and distroless images ship no ca-certificates
package), retry once with the webpki-root-certs Mozilla list merged in,
like Node's own bundled roots. A populated system store keeps sole
authority; failures the bundle cannot fix still surface the original
error. Windows keeps native-tls/SChannel and skips the fallback.
Closes #2278
Stack created with GitHub Stacks CLI • Give Feedback 💬