← All Fix Guides
medium
✓ Verified: 2026-11-26 Node.js 22 LTS / AGY v2.35.2
network agy agygemini-cligemini-api
UNABLE_TO_GET_ISSUER_CERT_LOCALLY & Corporate Proxy Reset
UNABLE_TO_GET_ISSUER_CERT_LOCALLY ECONNRESET SELF_SIGNED_CERT_IN_CHAIN
Matching Symptoms
- • Node-based CLI or MCP fails TLS handshake behind Zscaler, Netskope, or corporate MITM proxy.
- • Browser works normally, but `gemini` CLI and `npx agycraft-mcp` fail with certificate chain errors.
Root Cause
Node.js ships its own bundled CA store and ignores the OS corporate root CA unless `NODE_EXTRA_CA_CERTS` points to a readable PEM bundle, or `HTTPS_PROXY` is misconfigured.
Step-by-Step Fix
- 1 Export your organization's root CA certificate in PEM format (
.crt/.pem). - 2 Set
NODE_EXTRA_CA_CERTSto the absolute path of that PEM file in your shell profile. - 3 Verify
HTTPS_PROXY/NO_PROXYformatting (include schemehttp://orhttps://). - 4 Confirm readability with
npx agycraft-mcp doctor.
Copyable Commands
Configure Node extra CA bundle (macOS/Linux) (unix)
export NODE_EXTRA_CA_CERTS="/path/to/corporate-root-ca.pem" Configure Node extra CA bundle (PowerShell) (windows)
$env:NODE_EXTRA_CA_CERTS="C:\certs\corporate-root-ca.pem" Test TLS with Node native fetch (all)
node -e 'fetch("https://registry.npmjs.org/-/ping").then(r=>console.log("HTTP", r.status))' Verify Fix
Verify
node -e 'fetch("https://registry.npmjs.org/-/ping").then(r=>console.log("OK", r.status))'