How to update cacerts.txt of httplib2 for Github?

独自空忆成欢 提交于 2019-11-29 10:42:36

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.

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!