Search code examples
ibm-cloudnode-red

Error: self signed certificate with node red on IBM bluemix


I get this error "Error: self signed certificate : DEPTH_ZERO_SELF_SIGNED_CERT with an HTTPS request node, I am running Node Red on IBM Bluemix. In previous posts it was suggested to add an environment variable: export NODE_TLS_REJECT_UNAUTHORIZED=0 for Linux. Do you have any experience on how to make the HTTP/S request work from Node Red on Bluemix?


Solution

  • You can add environment variables to the context of a app on Bluemix via the web console.

    From the Application page, pick "Runtime" from the menu on the left hand side of the screen, then click on "Environment Variables" in the middle.

    enter image description here

    From here scroll to the bottom of the page. This will bring you to a section that will allow you to add an environment variable. Set the name to NODE_TLS_REJECT_UNAUTHORIZED and the value to 0.

    You will have to restart your application for this to come into effect.

    Also be aware that setting this variable opens up your application to potential man in the middle attacks as it will not check any outbound HTTPS to see if the certificate matches the issuer.