DEPTH_ZERO_SELF_SIGNED_CERT SSL / TLS Origin: Network Last updated 4 Nov 2026

Node/OpenSSL: Error: self signed certificate (code: DEPTH_ZERO_SELF_SIGNED_CERT)

The server presented a self-signed certificate (issuer equals subject), which no CA vouches for.

Exact message you may see Error: self signed certificateverify error:num=18:self signed certificateself-signed certificate (code: DEPTH_ZERO_SELF_SIGNED_CERT)
Seen on: SSL Node.js Linux

Meaning

Fine for local testing, not for production. For development, trust the certificate explicitly (add it to the client's CA list) or use mkcert to create a locally trusted CA. For production use a CA-issued certificate (Let's Encrypt is free).

Common causes

  • Development server with a self-signed cert
  • Appliance default certificate
  • Internal service never given a CA cert
  • Docker image generating a throwaway cert
  • Misconfigured proxy returning its own cert

⚡ Quick fix

  1. Use mkcert for local development
  2. Get a Let's Encrypt certificate for public hosts
  3. Pin or trust the specific cert in the client for internal tools

Detailed fix by platform

Linux

  1. mkcert -install && mkcert localhost 127.0.0.1 ::1

How to diagnose

  1. Issuer — Same as subject?
  2. Env — Dev or prod?
  3. Trust — Can the client trust it explicitly?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

AH01909: server certificate does NOT include an ID which matches the server name — Apache: [ssl:warn] AH01909: example.com:443:0 server certificate does NOT include an ID which matches the server name (SSL / TLS)AH01909: server certi…CAA record forbids issuance — Let's Encrypt/CA: CAA record for example.com prevents issuance (SSL / TLS)CAA record forbids is…curl: (60) SSL certificate problem — curl: (60) SSL certificate problem: unable to get local issuer certificate (SSL / TLS)curl: (60) SSL certif…ERR_CERT_AUTHORITY_INVALID — NET::ERR_CERT_AUTHORITY_INVALID (Your connection is not private) (JavaScript)ERR_CERT_AUTHORITY_IN…SELF_SIGNED_CERT_IN_CHAIN — npm ERR! code SELF_SIGNED_CERT_IN_CHAIN — request to https://registry.npmjs.org/ failed, reason: self signed certificate in certificate chain (npm)SELF_SIGNED_CERT_IN_C…SSLCertificateFile: file does not exist — Apache: AH02240: Server should be SSL-aware but has no certificate configured / SSLCertificateFile: file '/etc/ssl/x.crt' does not exist or is empty (SSL / TLS)SSLCertificateFile: f…Timeout during connect (likely firewall problem) — Let's Encrypt: Fetching http://example.com/.well-known/acme-challenge/token: Timeout during connect (likely firewall problem) (SSL / TLS)Timeout during connec…unable to get local issuer certificate — OpenSSL: error:num=20:unable to get local issuer certificate / SSL: CERTIFICATE_VERIFY_FAILED (SSL / TLS)unable to get local i…DEPTH_ZER…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.