I am running a REST API (Search API) with Tweepy in Python. I worked the program at home and it\'s totally fine. But now I am working on this in different networks and I got
For anybody that might stumble on this like I did, I had a similar problem because my company was using a proxy, and the SSL check failed while trying to verify the proxy's certificate.
The solution was to export the proxy's root certificate as a .pem
file. Then you can add this certificate to certifi
's trust store by doing:
import certifi
cafile = certifi.where()
with open(r, 'rb') as infile:
customca = infile.read()
with open(cafile, 'ab') as outfile:
outfile.write(customca)
You'll have to replace
with the path to the exported file. This should allow requests
(and tweepy
) to successfully validate the certificates.