您的位置:首页 > 产品设计 > UI/UE

错误pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')解决方案

2017-04-09 15:08 1911 查看
The problem is that 
pycurl
 needs
an up-to-date certificate chain to verify the ssl certificates.

A good solution would be to use certifi.

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 
pycurl
 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
相关文章推荐