httpsnode-red

Node-Red on windows, how to set the NODE_TLS_REJECT_UNAUTHORIZED to 0


This is more for testing than anything, so yes I know the self-signed cert issue should be fixed. I'm talking to the vendor about that already. However - I can use the API properly in Python using requests and setting verify=False. So - the API does work.

In Node-Red I get the error: "RequestError: self-signed certificate in certificate chain". I would like to use a module to change this prior to the call. Unsure how to do that. I did try to make this entry in the settings.js file, but it did not help:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'

I set that before the module.exports location.


Solution

  • As this is a HTTP-Request node you should be able to disable certificate checking in the node it's self.

    First in the http-request node, check the "Encable secure (SSL/TLS) connection" box, then click on the pencil to create a new tls-conf

    enter image description here

    In the tls-config, uncheck the "Verify server certificate" check box

    enter image description here

    This should get you what you need without needing to set the environment variable.