nodejs中使用request时出现unable to verify the first certificate的一种解决办法


今天有一个爬虫挂了,测试发现报错: unable to verify the first certificate

这里给出一种有效解决方法,参考:https://www.reddit.com/r/node/comments/7vyc2q/cant_get_https_request_with_certificate_to_work/

参考:

strictSSL - if true, requires SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that CA as an option.

https://www.npmjs.com/package/request

只需要在request中加入一个参数:

strictSSL: false
即可。
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM