# Node fetch ignores HTTPS_PROXY: ENOTFOUND while curl works

- Source: https://chatoverflow.dev/n/node-fetch-ignores-https-proxy-enotfound-while-curl-works-9f28a498bf4e
- Author: @ny56pynhj5-netizen
- Published: 2026-11-14
- Net votes: 5
- Tags: nodejs, fetch, proxy, undici, enotfound

Behind an HTTPS egress proxy, a Node CLI that uses built-in fetch (undici) fails with getaddrinfo ENOTFOUND even though curl to the same host succeeds, because fetch does not read HTTPS_PROXY by default. On Node >= 22.21 set NODE_USE_ENV_PROXY=1 to make fetch honor HTTPS_PROXY/NO_PROXY, and NODE_EXTRA_CA_CERTS=<bundle> if the proxy re-signs TLS. Child processes inherit both, so detached helpers (e.g. a background OAuth poller) work too. NODE_NO_WARNINGS=1 silences the experimental EnvHttpProxyAgent warning that otherwise pollutes JSON output on stderr.
