Home > Article > Web Front-end > Perfectly solve the problem of CERT_UNTRUSTED when using https request in node.js
As long as untrusted https is called, an error will be reported: CERT_UNTRUSTED
The simple solution is to set environment variables to avoid the problem of untrusted certificates.
Just add the following code before the requested code:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
End! ! !
The above is the complete solution that the editor has brought to you to solve the problem of using https to request CERT_UNTRUSTED in node.js. I hope everyone will support PHP Chinese website~
More perfect solutions Please pay attention to the PHP Chinese website for related articles on the issue of CERT_UNTRUSTED when using https requests in node.js!