Skip to content

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

@watiko

Description

@watiko

Describe the bug

When I ran the installation script in a WSL2 environment where Zscaler certificates were installed, an error occurred.
After checking the error details, it appeared that running vp install failed to retrieve the Node.js runtime list from https://nodejs.org/dist/index.json.
Since TLS communication worked correctly with curl and other programs, I suspected that the certificates were not being referenced properly. While reviewing the repository, I found the following:

  1. The reqwest version is 0.12
    reqwest = { version = "0.12", default-features = false }
  2. The enabled reqwest features are ["stream", "rustls-tls", "json"]
    [target.'cfg(not(target_os = "windows"))'.dependencies]
    reqwest = { workspace = true, features = ["stream", "rustls-tls", "json"] }
  3. In reqwest 0.12, specifying rustls-tls does not use the system’s CA certificates
    SSL_CERT_FILE vs feature=["rustls-tls"] - how to use? seanmonstar/reqwest#2640
  4. In reqwest 0.13, the handling of root certificates has been reorganized
    https://seanmonstar.com/blog/reqwest-v013-rustls-default/

As for possible fixes, I believe the options are either adjusting the feature flags while staying on reqwest 0.12, or upgrading to reqwest 0.13.

Reproduction

To reproduce this, you need to introduce a MITM proxy such as Zscaler on the network side, rather than relying on the contents of a repository.

Steps to reproduce

Run vp install under any MITM proxy.

System Info

~/watiko/.vite-plus/0.1.12/bin/vp env current
VITE+ - The Unified Toolchain for the Web

error: Failed to download Node.js runtime: Failed to download from https://nodejs.org/dist/index.json: error sending request for url (https://nodejs.org/dist/index.json)

❯ ~/watiko/.vite-plus/0.1.12/bin/vp --version
VITE+ - The Unified Toolchain for the Web

vp v0.1.12

Local vite-plus:
  vite-plus  Not found

Tools:
  vite             Not found
  rolldown         Not found
  vitest           Not found
  oxfmt            Not found
  oxlint           Not found
  oxlint-tsgolint  Not found
  tsdown           Not found

Environment:
  Package manager  Not found
  Node.js          Not found



error: Failed to download Node.js runtime: Failed to download from https://nodejs.org/dist/index.json: error sending request for urlhttps://nodejs.org/dist/index.json)

Used Package Manager

pnpm

Logs

Validations

Metadata

Metadata

Assignees

Labels

Type

Priority

High

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions