I am trying to use Github API with httplib2. But when I making requests to it\'s endpoints, it gives me following error:
import httplib2
h = httplib2.Http()
just update httplib2 package by
pip install --upgrade httplib2
or you can replace cacerts.txt this file directly https://github.com/httplib2/httplib2/blob/master/python2/httplib2/cacerts.txt
also if you use boto.txt file then you might use like boto.txt
ca_certificates_file = /etc/ssl/certs/ca-bundle.crt <--- location of your system cert
or you can specify your httplib2 cacerts.txt file by
ca_certificates_file = /usr/local/lib/python2.7/dist-packages/httplib2/python2/httplib2/cacerts.txt
UPD: The easiest way is to open GitHub in Firefox, View Page info -> Security -> View Certificate -> Details -> Export -> As PEM file. And also it is better to use requests.
From the information which Firefox gives about https connection, I found out that certificate for GitHub is "DigiCert High Assurance EV Root CA", which could be found here: http://curl.haxx.se/ca/cacert.pem
Text of certificate could be pasted to the httplib2.__path__ + '/cacerts.txt'
, or saved to separate file and than http connection should be created with:
h = httplib2.Http(ca_certs='/path/to/that/file')
Here is also useful post about this topic.