HTTP Diagnostic

Fix "unable to verify the first certificate" & UNABLE_TO_VERIFY_LEAF_SIGNATURE

Node.js rejected an HTTPS request because the destination SSL/TLS certificate chain is incomplete (missing intermediate CA certificate) or issued by an untrusted corporate proxy.

FetchError: unable to verify the first certificate / UNABLE_TO_VERIFY_LEAF_SIGNATURE

Quick Fix Checklist

  1. On server: Ensure Nginx/Apache serves fullchain.pem (certificate + bundle), not cert.pem alone
  2. For corporate VPNs: Export root certificate and run NODE_EXTRA_CA_CERTS=/path/to/ca.pem
  3. Never set NODE_TLS_REJECT_UNAUTHORIZED='0' in production