'Express Gateway errors on https self-signed certificate even with certificate verification disabled in Node

I am playing around and learning Express Gateway. The getting started guide requires that I make calls to an https endpoint. My organization runs all requests through a middlebox that sniffs https content and has its root certs installed on our machines. So basically all https payloads are signed with the organization's own certs.

Basically when Express Gateway makes the call and sees this cert it doesn't trust, it throws an error. I have tried to set NODE_TLS_REJECT_UNAUTHORIZED=0 to temporarily disable certificate verification, but still I see the error and the connection is rejected:

enter image description here

How can I temporarily disable certificate verification in Express Gateway?

As a longer term solution, I've seen a post about how to get Node to trust my OS certificates by setting the NODE_EXTRA_CA_CERTS environment variable, but I don't know which file to point to on my system as the certificate file

Update 1 (2020.26.02)

I followed Vicenzo's advice and tried to call the script directly rather than via an npm script but it doesn't work. I've added a console log at the top of the server.js file to see the value of NODE_TLS_REJECT_UNAUTHORIZED. When I don't set the variable, and I try to proxy to an https service this is what I see:

enter image description here

When I set the variable, again executing the script directly, this is what I see -- the gateway still rejects the self-signed certificate:

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source