Independent community project. Not affiliated with or endorsed by Google.
ModelCraft modelcraft.dev
← 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. 1 Export your organization's root CA certificate in PEM format (.crt / .pem).
  2. 2 Set NODE_EXTRA_CA_CERTS to the absolute path of that PEM file in your shell profile.
  3. 3 Verify HTTPS_PROXY / NO_PROXY formatting (include scheme http:// or https://).
  4. 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))'