Node complains because the TLS (SSL) certificate it gave is self-signed (i.e. it does not have a parent - depth 0). He expects to find a certificate signed by another certificate that is installed in your OS as a trusted root.
“Fix” - disable Node from rejecting self-signed certificates by allowing ANY unauthorized certificate.
Your correction is unsafe and should not be performed at all, but is often done in development (it should never be done in production).
The right decision should be to put the self-signed certificate in a trusted root store or get the proper certificate signed by an existing certificate authority (which is already trusted to your server).
As an additional point in your journal should be indicated "Disabling Node rejection of invalid / unauthorized certificates"
source share