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