我使用nodejs提供的request module向一个https发起请求,遇到下面这个错误:
DEPTH_ZERO_SELF_SIGNED_CERT
self signed certificate


解决方案:

在构造http请求时,指定:
strictSSL: false, // allow us to use our self-signed cert for testing
rejectUnauthorized: false
这样就能忽略掉错误:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
