AspBucket offers ASP.NET, C#, VB, Jquery, CSS, Ajax, SQL tutorials. It is the best place for programmers to learn

Friday 3 March 2023

How to add extra SSL certificates in Node JS server?

If node server is communicating with other Server & trusted certificate installed on the other server. Then Node Server could get certificate error like "Chain of trust issue". To over come this issue Trusted certificate also need to be added in the Node server.

For example in above diagram Node server is trying to communicate with Server A & Server B  then ssl certificate of server A & B also need to be known by the Node Server. 

To add the extra certificate Please follow below steps.

Set the NODE_EXTRA_CA_CERTS in system enviroment variable.

  • Create a file rootCA.pem file anywhere in system.
  • Add CA certificate string in rootCA.pem file and save it.
  • On your server, right-click This PC and select Properties.
  • Click Advanced system settings.
  • In System Properties, click Environment Variables.
  • In Environment Variables, under the System variables area, click New.
  • In the New System Variable dialog box, in the Variable name field, enter NODE_EXTRA_CA_CERTS and set the certificate path(rootCA.pem) as value.
  •  Restart your computer. This should resolve connection problems caused by sign certificates.


Post a Comment

  • Popular Posts
  • Comments