GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: upgrade reqwest from 0.12 to 0.13 and rename the rustls-tls feature to rustls by Giorno-Giovana · Pull Request #1068 · voidzero-dev/vite-plus

Conversation

@Giorno-Giovana

@Giorno-Giovana Giorno-Giovana commented Mar 20, 2026 •
edited by fengmk2
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

closes #1014

Motivation

vp install fails on macOS with a TLS error when trying to download the Node.js runtime from nodejs.org:

error: Failed to download Node.js runtime: Failed to download from
https://nodejs.org/dist/v22.18.0/SHASUMS256.txt: error sending request for url

The root cause is how reqwest 0.12 handles TLS certificate verification on non-Windows platforms. With the
rustls-tls feature, it uses webpki-roots — a hardcoded bundle of Mozilla root certificates compiled into the
binary. If the server's certificate chain involves a CA not present in that bundle (or the bundle is
outdated), TLS verification fails, even though the system's certificate store (macOS Keychain) trusts the
certificate.

reqwest 0.13 replaces the rustls-tls feature with rustls, which uses rustls-platform-verifier instead of
webpki-roots. This verifier delegates certificate validation to the OS-native certificate store
(Security.framework on macOS, SChannel on Windows), matching the behavior of curl and other system tools.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

SviatoslavKaptelinin reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@netlify

netlify Bot commented Mar 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

✅ Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 866643b
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69c3488bccaf1e00083c5498
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Giorno-Giovana Giorno-Giovana changed the title Up reqwest version Upgrade reqwest from 0.12 to 0.13 and rename the rustls-tls feature to rustls (the new name in 0.13) Mar 20, 2026
@Giorno-Giovana Giorno-Giovana mentioned this pull request Mar 20, 2026
reqwest calls in vp fail when running behind a MITM proxy. #1014
Closed
4 tasks done
@Giorno-Giovana Giorno-Giovana closed this Mar 20, 2026
@fengmk2

fengmk2 commented Mar 20, 2026

Copy link
Copy Markdown
Member

@Giorno-Giovana why close?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Giorno-Giovana

Giorno-Giovana commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

@fengmk2 looks like duplicate https://github.com/dwhoban/vite-plus/pull/1

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Giorno-Giovana

Giorno-Giovana commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

But I think this could be merged anyway😁

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Giorno-Giovana Giorno-Giovana reopened this Mar 21, 2026
@Giorno-Giovana
Giorno-Giovana force-pushed the main branch from 780761a to 083a6bd Compare March 21, 2026 07:45
@fengmk2

fengmk2 commented Mar 21, 2026

Copy link
Copy Markdown
Member

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Mar 21, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fengmk2 fengmk2 changed the title Upgrade reqwest from 0.12 to 0.13 and rename the rustls-tls feature to rustls (the new name in 0.13) fix: upgrade reqwest from 0.12 to 0.13 and rename the rustls-tls feature to rustls Mar 21, 2026
fengmk2
fengmk2 reviewed Mar 21, 2026
View reviewed changes

@fengmk2 fengmk2 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I will release a test version to verify before I merge.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fengmk2

fengmk2 commented Mar 21, 2026

Copy link
Copy Markdown
Member

macOS build fails

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Giorno-Giovana
Giorno-Giovana force-pushed the main branch from 083a6bd to fb3d428 Compare March 23, 2026 09:27
@Giorno-Giovana

Giorno-Giovana commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

The macOS build fails because reqwest 0.13 with the rustls feature pulls in aws-lc-rs as the default crypto
provider.

Fix: Switch from aws-lc-rs to ring as the crypto provider:

  1. Changed reqwest feature from rustls to rustls-no-provider (avoids pulling in aws-lc-sys)
  2. Added rustls as a workspace dependency with ring feature enabled
  3. Added ensure_tls_provider() calls that install the ring crypto provider at runtime (using OnceLock for
    one-time initialization)

This completely removes aws-lc-sys from the dependency tree while keeping the same TLS behavior (platform
certificate verification via rustls-platform-verifier).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Giorno-Giovana
Giorno-Giovana requested a review from fengmk2 March 23, 2026 09:39
fengmk2
fengmk2 reviewed Mar 24, 2026
View reviewed changes
Comment thread crates/vite_install/src/request.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

fengmk2
fengmk2 reviewed Mar 24, 2026
View reviewed changes
Comment thread crates/vite_js_runtime/src/download.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Giorno-Giovana and others added 2 commits March 24, 2026 15:57
@Giorno-Giovana a.zavernyaev
Up reqwest version
8697036
a.zavernyaev
Remove aws-lc-rs
0ad5cb0
@Giorno-Giovana
Giorno-Giovana force-pushed the main branch from fb3d428 to bb7b85b Compare March 24, 2026 13:07
a.zavernyaev
Fix windows build and update Cargo.lock
f2a2c7b
@Giorno-Giovana
Giorno-Giovana force-pushed the main branch from bb7b85b to f2a2c7b Compare March 24, 2026 13:09
@Giorno-Giovana
Giorno-Giovana requested a review from fengmk2 March 24, 2026 13:11
fengmk2
fengmk2 approved these changes Mar 24, 2026
View reviewed changes

@fengmk2 fengmk2 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Giorno-Giovana Thanks a lot! I will merge after manual verification passes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fengmk2
Merge branch 'main' into main
5dd1dc0
@fengmk2 fengmk2 mentioned this pull request Mar 25, 2026
fix(deps): use native OS certificate store for TLS on non-Windows platforms #1134
Closed
@fengmk2
fengmk2 requested a review from Copilot March 25, 2026 01:15
Copilot started reviewing on behalf of fengmk2 March 25, 2026 01:16
View session
Copilot AI reviewed Mar 25, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the workspace to reqwest 0.13 and adjusts TLS configuration on non-Windows platforms so HTTPS requests use OS-native certificate verification (via rustls-platform-verifier), addressing TLS failures behind MITM proxies / certain macOS trust-chain scenarios.

Changes:

  • Bump workspace reqwest from 0.12 to 0.13 and update per-crate TLS feature flags (rustls-tls → rustls-no-provider on non-Windows).
  • Add a shared vite_shared::ensure_tls_provider() helper and call it before reqwest usage on non-Windows.
  • Add workspace rustls dependency (ring provider) and refresh Cargo.lock accordingly.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/vite_shared/src/tls.rs New helper to install a rustls crypto provider on non-Windows.
crates/vite_shared/src/lib.rs Exposes ensure_tls_provider from vite_shared.
crates/vite_shared/Cargo.toml Adds non-Windows dependency on rustls.
crates/vite_js_runtime/src/download.rs Ensures TLS provider is installed before making reqwest requests.
crates/vite_js_runtime/Cargo.toml Switches non-Windows reqwest feature to rustls-no-provider.
crates/vite_install/src/request.rs Ensures TLS provider is installed before making reqwest requests.
crates/vite_install/Cargo.toml Switches non-Windows reqwest feature to rustls-no-provider.
crates/vite_error/Cargo.toml Switches non-Windows reqwest feature to rustls-no-provider.
Cargo.toml Upgrades workspace reqwest to 0.13 and adds workspace rustls dependency.
Cargo.lock Lockfile updates for reqwest 0.13 + new TLS dependency graph.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread crates/vite_shared/src/tls.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@fengmk2
Merge branch 'main' into main
a0e0e8a
@fengmk2

fengmk2 commented Mar 25, 2026

Copy link
Copy Markdown
Member

@Giorno-Giovana I'll take over and make some improvements

Giorno-Giovana reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fengmk2 added 6 commits March 25, 2026 09:56
@fengmk2
fix: document Alpine ca-certificates requirement and fix review issues
08959d1
- Document ca-certificates as required on Alpine for TLS verification
- Add CI negative test proving install.sh fails without ca-certificates
- Add comment explaining silent error ignore in TLS provider init
- Ignore flaky SHA224 test on musl (same race condition as SHA1 test)
@fengmk2
fix(ci): test vp TLS failure without ca-certificates on Alpine
c1ea842
The negative test now removes /etc/ssl/certs/ca-certificates.crt after
vp is installed, then verifies that vp HTTPS calls fail. This proves
rustls-platform-verifier requires OS root CAs.

The previous approach (skipping ca-certificates in apk add) didn't work
because curl transitively pulls in ca-certificates-bundle.
@fengmk2
fix(ci): move ca-certificates test to Alpine E2E job
a40a2df
Move the TLS negative test from test-standalone-install.yml to the
"Run E2E in Alpine container" step in ci.yml, which is the proper
place to test vp runtime behavior on Alpine.
@fengmk2
fix(ci): remove ca-certificates negative test
1a5153b
The fallback to bundled root certs will make this test unnecessary.
@fengmk2
fix: remove incorrect ca-certificates documentation and comments
1a6ae62
ca-certificates is not a user requirement since the TLS stack will
fall back to bundled Mozilla root certificates when the system cert
store is empty.
@fengmk2
Merge branch 'main' into main
866643b
@fengmk2
fengmk2 merged commit 2ce7af3 into voidzero-dev:main Mar 25, 2026
35 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@jbmusso jbmusso mentioned this pull request Jul 29, 2026
fix(http): return an error when the HTTP client cannot be built #2273
Merged
@fengmk2 fengmk2 mentioned this pull request Jul 31, 2026
Fall back to bundled Mozilla roots when the system CA store is empty #2278
Closed
fengmk2 added a commit that referenced this pull request Aug 2, 2026
@jbmusso @fengmk2
fix(http): return an error when the HTTP client cannot be built (#2273)
d4036af
## Problem

This surfaced while upgrading vite-plus from 0.1.21 to 0.2.6 in a CI
pipeline running on `node:24-bookworm-slim`: the lint and format jobs
started aborting with exit 134, having been green on 0.1.21 on the same
image.

The branch is two commits, so the bug can be inspected before the fix:
check out the first commit and run `cargo test -p vite_shared --lib
client_build_failure` to see the failure as a failing test, on an
otherwise unmodified tree. The second commit is an attempt at a fix.

`shared_http_client` panics whenever the client cannot be built, and
every input funnels into that one `panic!`: no system CA bundle, a
malformed proxy setting, an unusable TLS backend, an unparsable extra CA
bundle. Its doc comment states that a panic was chosen over
`process::exit` so that:

```
/// destructors of in-flight work still run (lockfiles released, tempfiles
/// cleaned) and an embedding Node host (NAPI) keeps the process alive.
```

`Cargo.toml` has, under `[profile.release]`:

```toml
panic = "abort" # Let it crash and force ourselves to write safe Rust.
```

`abort` does not unwind, so in every release build the panic delivers
neither property it was chosen for: lockfiles and temp dirs are not
cleaned, and SIGABRT takes the embedding Node host down with it. The
comment and the release profile have drifted apart, and every one of
those inputs becomes an unrecoverable abort, worst in exactly the
NAPI-embedded case the comment was written to protect.

The input that is near-universal in Debian-slim Node images is the
missing CA bundle: they ship no `ca-certificates` package, and Node
carries its own root list, so `node` and `npm` keep working and nothing
else reveals it. On such an image any direct `vp` subcommand aborts
instead of running:

```
Vite+ panicked. This is a bug in Vite+, not your code.

thread '<unnamed>' panicked at crates/vite_shared/src/http.rs:58:21:
failed to initialize HTTP client: builder error: unexpected error: No CA certificates were loaded from the system

Aborted (core dumped)          # exit 134
```

Reproduces in about 30s with only Docker:

```bash
docker run --rm -w /app node:24-bookworm-slim sh -c '
echo "{\"name\":\"repro\",\"private\":true}" > package.json
npm i --silent [email protected]
echo "{\"name\":\"repro\",\"private\":true,\"packageManager\":\"[email protected]\"}" > package.json
./node_modules/.bin/vp fmt --check
echo "exit=$?"'
```

Holding image and project constant and varying only the vp version,
0.1.22 exits 1 with a handled error and 0.1.23 is the first release that
aborts, the release that shipped the shared client from #1686. The empty
trust store itself is not new (it has mattered since #1068 moved
verification onto the OS store to fix #1014); what changed is that it
became fatal.

Mechanism: `execute_direct_subcommand` calls
`envs_with_explicit_package_manager_path` for every direct subcommand.
With a `packageManager` field and a cold cache that downloads the pinned
package manager, which builds the shared client. Nothing here actually
needs the network, since the download failure is already handled and
falls back to the unmodified `PATH`, so with any single root certificate
present the same command completes normally even under `--network none`.
Without a `packageManager` field there is no download attempt and no
crash, which is why this only shows up on projects that pin one.

## Solution

`shared_http_client` now returns `Result<&Client, HttpClientError>`, and
the six call sites `?` it into the errors they already return. That
restores the behaviour the doc comment describes rather than adding a
new policy: callers already treat "no HTTP client" as a handled outcome,
they just never got the chance to. Every failure at that point is an
environment condition (no system CA bundle, an unusable proxy, an
unparsable extra CA bundle), so the message names the cause and the
remedy instead of asking for a bug report, which currently points away
from the fix.

The two artifacts cover different things, deliberately. The Docker
snippet above reproduces the reported symptom; the unit test pins the
branch. I could not reproduce the empty trust store portably in a unit
test, because macOS resolves roots through Security.framework and
`SSL_CERT_FILE` cannot empty the store there, so the test drives the
same `build()` failure branch through the documented `SSL_CERT_FILE`
contract, using a PEM block whose body is not valid DER. To check the
real condition I built the patched `vite_shared` in a Debian container
and deleted its CA store: it now returns the error and exits 0 instead
of aborting.

I only looked at this one call site, where the doc comment states the
intent explicitly, so I can't say whether the same drift between a
documented panic rationale and `panic = "abort"` exists anywhere else.
You may want to check.

### Note

The investigation and this patch were done with AI assistance, and my
own Rust is limited, so please scrutinise the implementation closely.
The diagnosis is empirically verified (bisected across releases,
reproduced in a container), but I have lower confidence in the patch
being the shape you would want. Happy to rework it however you prefer,
or to leave the diagnosis with you if you would rather fix it
yourselves.

---------

Co-authored-by: MK (fengmk2) <[email protected]>
@gwkline gwkline mentioned this pull request Nov 19, 2026
fix(build): bump vite-plus 0.2.4 -> 0.2.9 to stop SIGABRT on CA-less build images gwkline/personal-site#30
Closed
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@fengmk2 fengmk2 fengmk2 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

reqwest calls in vp fail when running behind a MITM proxy.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Giorno-Giovana @fengmk2
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.