When I call for the Google Earth Engine (GEE) Python APIs through Google AppEngine, it throws out a HTTPException which says "HTTPException: invalid and/or missing SSL certificate for url: https://accounts.google.com/o/oauth2/token". The project runs well before the New Year's Holiday, but it suddenly broke out without any changes on my own codes when I tested it on yesterday.
HTTPException: invalid and/or missing SSL certificate for url: https://accounts.google.com/o/oauth2/token
2k views Asked by Zelong AtThere are 3 answers
On the tracker for this GAE issue, the maintainers give a workaround:
As a temporary workaround, you can replace the expired urlfetch_cacerts.txt with https://curl.haxx.se/ca/cacert.pem
On linux you can use the following command: wget https://curl.haxx.se/ca/cacert.pem -O {Root of Python SDK}/lib/cacerts/urlfetch_cacerts.txt
For Windows, because the SDK is stored in an Admin Read-only area, I used Windows File Explorer in two steps instead of a script.
First download https://curl.haxx.se/ca/cacert.pem to a folder, e.g. Downloads.
curl https://curl.haxx.se/ca/cacert.pem > urlfetch_cacerts.txt
You can also use a browser to download the file and rename it.
Check where your cacerts are stored. I found them in
C:\Program Files (x86)\Google\google_appengine\lib\cacerts
Others report it in:
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\cacerts\urlfetch_cacerts.txt
With Admin credentials, rename the file urlfetch_cacerts.txt to something else.
Then copy the downloaded file cacerts.pem to
C:\Program Files (x86)\Google\google_appengine\lib\cacerts
And rename it to urlfetch_cacerts.txt
Voila!
I am also experiencing the same issue in my python script with App Engine. It was running fine a few days ago and the certificate for accounts.google.com is valid until March, 9th 2017
Edit: it looks like the issue has been reported here a few hours ago : https://code.google.com/p/googleappengine/issues/detail?id=13477