Home >Web Front-end >JS Tutorial >Perfectly solve the problem of CERT_UNTRUSTED when using https request in node.js

Perfectly solve the problem of CERT_UNTRUSTED when using https request in node.js

高洛峰
高洛峰Original
2017-01-10 11:49:331900browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn