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

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()

你可能感兴趣的:(python编程)