今天通过Pycurl发送HTTPS请求时报错:
pycurl.error: (60, 'SSL certificate problem: self signed certificate in certific
很明显,验证证书的时候出现了问题。
通过搜索找到这篇贴子,速度解决困惑拿出来给大家分享(关键点)
It's basically an up-to-date copy of mozilla's built in certificate chain wrapped in a python package which can be kept up to date using pip. certifi.where() gives you the location to the certificate bundle.
To make pycurses to use it, set the CAINFO option:
import pycurl
import certifi
curl = pycurl.Curl()
curl.setopt(pycurl.CAINFO, certifi.where())
curl.setopt(pycurl.URL, 'https://www.quora.com')
curl.perform()

本文解决使用Pycurl发送HTTPS请求时遇到的自签名证书验证错误,通过设置CAINFO选项引入certifi包中的证书集,成功解决SSL验证问题。
1860

被折叠的 条评论
为什么被折叠?



