NODE_EXTRA_CA_CERTS cannot be set in code or relative · Issue #20432 · nodejs/node (original) (raw)

When I start my server with

NODE_EXTRA_CA_CERTS=/Users/sheerun/Source/Ada/search/.certs/ca.crt bin/start

and in code make request to http server that serves with given certificate, all is good

But when I set it at the beginning of bin/start as so:

process.env.NODE_EXTRA_CA_CERTS = "/Users/sheerun/Source/Ada/search/.certs/ca.crt"

then node complains that there's "self signed certificate in certificate chain".

Particularly NODE_EXTRA_CA_CERTS doesn't work when I use dotenv package and set NODE_EXTRA_CA_CERTS in .env file.

Also, it seems NODE_EXTRA_CA_CERTS doesn't allow relative path, just absolute.

I think both of these issues should be addressed or at least documented with reasons why.