Software⏱️ 2 min read📅 2026-06-03

How to Fix: nodejs - error self signed certificate in certificate chain

The issue is caused by the self-signed certificate not being trusted by default. To resolve this, you need to add the certificate to the client's trust store or use a library that trusts self-signed certificates.

Quick Answer: Use the https agent with the rejectUnauthorized option set to false and manually verify the certificate chain.

The 'self signed certificate in certificate chain' error occurs when the client-side HTTPS request is unable to verify the authenticity of the server's SSL/TLS certificate. This issue can be resolved by installing the root certificate of the server on the client machine.

🚀 How to Resolve This Issue

Method 1: Installing Root Certificate using Windows Certificates Store

  1. Step 1: Open the Windows Certificates store by typing certlm.msc in the Run dialog box.

Method 2: Installing Root Certificate using Linux Certificates Store

  1. Step 1: Open the Linux Certificates store by typing update-ca-certificates in the terminal.

Method 3: Installing Root Certificate using macOS Keychain

  1. Step 1: Open the Keychain Access application and navigate to the Certificates section.

By following these steps, you should be able to install the root certificate on your client machine and resolve the 'self signed certificate in certificate chain' error.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions