我正在使用Python GAE的本地開發環境。在我的代碼,我使用的是app_identity
模塊來獲取應用程序ID令牌對我的項目,像這樣:獲取SSLCertificateError獲取OAuth令牌訪問Google Cloud Services
scope = "https://www.googleapis.com/auth/userinfo.email"
app_id_token, expiry = app_identity.get_access_token(scope)
但被調用的途徑時,我得到這個錯誤從AppEngine上模塊拋出。看來,當我的項目嘗試獲取OAuth令牌以訪問Google Cloud服務時,它將在用於獲取該令牌的網址上收到SSL驗證錯誤。
ERROR 2017-01-03 02:41:11,489 api_server.py:272] Exception while handling service_name: "app_identity_service"
method: "GetAccessToken"
request: "\n.https://www.googleapis.com/auth/cloud-platform"
request_id: "MzGyxBKeMe"
Traceback (most recent call last):
File "/opt/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 247, in _handle_POST
api_response = _execute_request(request).Encode()
File "/opt/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 186, in _execute_request
make_request()
File "/opt/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 181, in make_request
request_id)
File "/opt/google-cloud-sdk/platform/google_appengine/google/appengine/api/apiproxy_stub.py", line 131, in MakeSyncCall
method(request, response)
File "/opt/google-cloud-sdk/platform/google_appengine/google/appengine/api/app_identity/app_identity_keybased_stub.py", line 223, in _Dynamic_GetAccessToken
headers={'Content-Type': 'application/x-www-form-urlencoded'})
File "/opt/google-cloud-sdk/platform/google_appengine/google/appengine/api/urlfetch.py", line 271, in fetch
return rpc.get_result()
File "/opt/google-cloud-sdk/platform/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 613, in get_result
return self.__get_result_hook(self)
File "/opt/google-cloud-sdk/platform/google_appengine/google/appengine/api/urlfetch.py", line 432, in _get_fetch_result
'Invalid and/or missing SSL certificate for URL: ' + url)
SSLCertificateError: Invalid and/or missing SSL certificate for URL: https://accounts.google.com/o/oauth2/token
讓我感到困惑的是,這似乎並不是環境配置問題,因爲它是SSL證書驗證。但是,當我們從我們的存儲庫中的同一提交開始工作時,我的隊友都沒有看到這個問題。我試過重新克隆我的存儲庫,重啓我的機器,重新設置我的Docker設置。沒有一個效果。任何意見,如何進行,將不勝感激。謝謝。