All Recipes
StarVerified Developer Solution • 100% Offline
X.509 Certificate & CSR Decoder

Fix "self signed certificate in certificate chain"

Resolve Node.js SSL handshake failures when connecting to internal corporate networks.

The Problem (Error Root Cause)Exception

Your app throws `self signed certificate in certificate chain`. This happens frequently in corporate networks that use SSL interception proxies, or when testing against local dev servers with self-signed certs.

Identified via runtime validation & stack traces
The Solution (Step-by-Step Fix)Verified

For development, you can bypass this via an environment variable. For production, you must obtain the corporate Root CA certificate and tell Node.js to trust it.

Deterministic, non-destructive resolution

Code Standard: Bad Pattern vs Verified Fix

Live Syntax
Anti-Pattern vs Verified Fix
1// ❌ Bad: Insecure bypass (Dev only)
2process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
3
4// ✅ Good: Add corporate CA to global agent
5require('https').globalAgent.options.ca = fs.readFileSync('corp-ca.crt');

Test and resolve this using X.509 Certificate & CSR Decoder

Execute directly in your browser memory. Zero API keys, zero network tracking, completely client-side.

Launch X.509 Certificate & CSR Decoder

Frequently Asked Questions

Q:Why does curl work but Node fails?

Your OS or curl might have the corporate CA installed in their trust store. Node.js uses its own hardcoded Mozilla trust store.

Q:How do I inspect the self-signed cert?

Use our Certificate Decoder to inspect the issuer and confirm it's your corporate proxy.

Related Troubleshooting Guides

View Directory