Reputation: 1751
I know similar questions have been asked before but I have read all of them and I still cannot figure out a solution for my problem.
I am basically working behind a corporate proxy, so when I do for a example a get request to Google with something like this:
import requests
requests.get('https://www.google.es')
I immediately get an error which points towards a fail in certificate verification. After much reading I have found this post where you can get a sweet explanation of what is going on.
Some solutions I have tried are: 1.https://stackoverflow.com/a/42540637/8380638 2.https://stackoverflow.com/a/48636689/8380638
But still I could not make this work.
My main goal is using Google Translate API from google.cloud python module which uses requests on it. So it would be good to find some fix that goes further from adding a parameter into request.get() function.
Upvotes: 1
Views: 3910
Reputation: 1751
I finally found the solution for this, but I forgot to post it.
You can use this to find the path where request library CAs are stored and add your own one at the end of the file.
import requests as r
print(r.certs.where())
Upvotes: 1
Reputation: 327
You can get the Google Translate API without using the requests library. Simply install the google-cloud-translate library and setup the required authentication on your Google Cloud Platform account as described in the documentation. Once completed, you can directly import the Translate API using the following line:
from google.cloud import translate
Upvotes: 1