10

當我通過Google AppEngine調用Google Earth Engine(GEE)Python API時,它會拋出一個HTTPException,其中顯示「HTTPException:無效和/或缺少url證書的SSL證書:https://accounts.google.com/o/oauth2/token」。該項目在新年假期前運行良好,但當我在昨天進行測試時,它突然爆發,沒有對自己的代碼進行任何更改。HTTPException:對於url無效和/或缺少SSL證書:https://accounts.google.com/o/oauth2/token

The detailed error information

+1

該錯誤已報告給Google,您可以在此處查看其狀態:https://code.google.com/p/googleappengine/issues/detail?id=13477 – ValLeNain

回答

6

我也經歷着我與App Engine python腳本同樣的問題。 這是前幾天罰款運行和accounts.google.com證書有效期至三月,9日2017年

File "/Users/QQQ/Documents/Developpements/ae-python-project/app/user_spreadsheet_auth.py", line 55, in _get_service 
    service = build('sheets', 'v4', http=http_auth) 
File "/Users/QQQ/Documents/Developpements/ae-python-project/libs/oauth2client/_helpers.py", line 133, in positional_wrapper 
    return wrapped(*args, **kwargs) 
File "/Users/QQQ/Documents/Developpements/ae-python-project/libs/googleapiclient/discovery.py", line 222, in build 
    cache) 
File "/Users/QQQ/Documents/Developpements/ae-python-project/libs/googleapiclient/discovery.py", line 269, in _retrieve_discovery_doc 
    resp, content = http.request(actual_url) 
File "/Users/QQQ/Documents/Developpements/ae-python-project/libs/oauth2client/transport.py", line 159, in new_request 
    credentials._refresh(orig_request_method) 
File "/Users/QQQ/Documents/Developpements/ae-python-project/libs/oauth2client/client.py", line 744, in _refresh 
    self._do_refresh_request(http) 
File "/Users/QQQ/Documents/Developpements/ae-python-project/libs/oauth2client/client.py", line 775, in _do_refresh_request 
    body=body, headers=headers) 
File "/Users/QQQ/Documents/Developpements/ae-python-project/libs/oauth2client/transport.py", line 282, in request 
    connection_type=connection_type) 
File "/Users/QQQ/Documents/Developpements/ae-python-project/libs/httplib2/__init__.py", line 1609, in request 
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) 
File "/Users/QQQ/Documents/Developpements/ae-python-project/libs/httplib2/__init__.py", line 1351, in _request 
    (response, content) = self._conn_request(conn, request_uri, method, body, headers) 
File "/Users/QQQ/Documents/Developpements/ae-python-project/libs/httplib2/__init__.py", line 1307, in _conn_request 
    response = conn.getresponse() 
File "/Users/QQQ/google-cloud-sdk/platform/google_appengine/google/appengine/dist27/gae_override/httplib.py", line 532, in getresponse 
    raise HTTPException(str(e)) 
HTTPException: Invalid and/or missing SSL certificate for URL: https://accounts.google.com/o/oauth2/token 

編輯:它看起來像這個問題已經在幾個小時前這裏報道:https://code.google.com/p/googleappengine/issues/detail?id=13477

+3

作爲快速解決方法,您可以將cacerts重命名爲_cacerts.txt中的.txt和urlfetch_cacerts.txt以及文件夾google-cloud-sdk/platform/google_appengine/lib/cacerts /中的_urlfetch_cacerts.txt,然後重新啓動您的開發服務器。 –

+0

它的工作原理!非常感謝你! – Zelong

0

對於Windows,因爲SDK存儲在管理員讀 - 只有區域,我使用Windows文件資源管理器分兩步而不是腳本。

首先下載https://curl.haxx.se/ca/cacert.pem到文件夾,例如,下載。

curl https://curl.haxx.se/ca/cacert.pem > urlfetch_cacerts.txt 

您還可以使用瀏覽器下載文件並重命名它。

檢查您的cacerts存儲在哪裏。我發現他們在

C:\Program Files (x86)\Google\google_appengine\lib\cacerts 

其他report它:

C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\cacerts\urlfetch_cacerts.txt 

使用管理員憑據,重命名文件urlfetch_cacerts.txt別的東西。

然後將下載的文件cacerts.pem複製到

C:\Program Files (x86)\Google\google_appengine\lib\cacerts 

,並改名爲urlfetch_cacerts.txt

瞧!