5

I am using Nodejs/Express along with nginx. I am trying to make https.request from an Express route which results in self signed certificate error. I have resolved the error in development mode using:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"

which worked perfectly. I will be deploying my application on CentOS. My question is how to avoid the same error in production mode. Nginx is being used on CentOS too. I tried creating the certificate on CentOS based on How To Create a SSL Certificate on nginx for CentOS 6

But, that doesn't solve the purpose as the Node application can be running on any CentOS VM and I don't want to perform these steps for each virtual machine. Is there anything which I can do from the application side to avoid this error in production?

Some of the similar questions that I already went through on StackOverflow are:

Community
  • 1
  • 1
aryan_m
  • 51
  • 3

0 Answers0