yarnpkg / yarnpkg/zpm

yarn switch: error sending request for url

Open
#247 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
225
Forks
19
Avg merge
1d 5h
Merged PRs (30d)
3

Description

I'm trying to use yarn switch but I immediately encounter issues:

$ cd (mktemp -d)
$ source ~/.yarn/switch/env.fish 
$ yarn init -y
Error: error sending request for url (https://repo.yarnpkg.com/channels/default/stable)

› yarn init […ARGSN]

I should note that I'm running on a device with a TLS intercepting proxy installed on it, so repo.yarnpkg.com responds using a certificate signed by a private CA. This CA is installed on my system, so for e.g. yarn berry and corepack I'm used to passing NODE_OPTIONS=--use-system-ca for certain commands.

$ node
Welcome to Node.js v24.12.0.
Type ".help" for more information.
> await (await fetch("https://repo.yarnpkg.com/channels/default/stable")).text()
Uncaught TypeError: fetch failed
    at node:internal/deps/undici/undici:15845:13
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
    at async REPL1:1:40 {
  [cause]: Error: unable to get local issuer certificate
      at TLSSocket.onConnectSecure (node:_tls_wrap:1631:34)
      at TLSSocket.emit (node:events:508:28)
      at TLSSocket.emit (node:domain:552:15)
      at TLSSocket._finishInit (node:_tls_wrap:1077:8)
      at ssl.onhandshakedone (node:_tls_wrap:863:12)
      at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
    code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
  }
}

$ node --use-system-ca
Welcome to Node.js v24.12.0.
Type ".help" for more information.
> await (await fetch("https://repo.yarnpkg.com/channels/default/stable")).text()
'6.0.0-rc.13\n'

$ openssl s_client -connect repo.yarnpkg.com:443 -showcerts </dev/null 2>/dev/null | openssl x509 -text -noout | head -n10
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            Redacted
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: C=Redacted, O=Redacted., OU=Redacted., CN=Redacted Intermediate Root CA 
        Validity
            Not Before: Feb  9 05:38:18 2026 GMT
            Not After : Feb 21 05:13:57 2026 GMT

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with yarn switch, source ~/.yarn/switch/env.fish, and a TLS-intercepting proxy, then compare it with Node's successful --use-system-ca request to the same URL. Done means yarn init -y can fetch the default channel through a private-CA proxy without the reported certificate error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, rust
Domain
cli, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.