Google Cloud SSLHandshakeError



我们正在尝试从google cloud下载手机应用的评论评分和统计数据。

在服务器机的一个ubuntu盒子里,我安装了gcloud。我使用gcloud auth命令在盒子中进行身份验证。我使用以下代码来获取桶
client = storage.Client(cfg.get('google-play','client'))
bucket = client.get_bucket(cfg.get('google-play','bucket')) 

有时get_bucket抛出以下异常。大多数情况下它工作得很好

File "google-crashes-anrs-api/DailyDownloadAndInsert.py", line 76, in <module>
    bucket = client.get_bucket(cfg.get('google-play','bucket'))
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/gcloud/storage/client.py", line 167, in get_bucket
    bucket.reload(client=self)
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/gcloud/storage/_helpers.py", line 77, in reload
    _target_object=self)
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/gcloud/connection.py", line 343, in api_request
    target_object=_target_object)
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/gcloud/connection.py", line 241, in _make_request
    return self._do_request(method, url, headers, data, target_object)
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/gcloud/connection.py", line 270, in _do_request
    body=data)
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/oauth2client/transport.py", line 153, in new_request
    credentials._refresh(orig_request_method)
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/oauth2client/client.py", line 765, in _refresh
    self._do_refresh_request(http_request)
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/oauth2client/client.py", line 797, in _do_refresh_request
    self.token_uri, method='POST', body=body, headers=headers)
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/httplib2/__init__.py", line 1609, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/httplib2/__init__.py", line 1351, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/httplib2/__init__.py", line 1272, in _conn_request
    conn.connect()
  File "/usr/apps/mnstools/apps/.virtualenvs/google-crashes-anr/lib/python2.7/site-packages/httplib2/__init__.py", line 1059, in connect
    raise SSLHandshakeError(e)
httplib2.SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

如果我缺少任何配置,任何人都可以帮助我。我很笨,因为它有时有效,有时失败。

您可能在安装openssl时遇到问题。检查您是否安装了最新的openssl,并尝试最新的google-cloud-storage包。如果仍然失败,请尝试在不同的机器或虚拟环境中使用最新的软件包。

相关内容

  • 没有找到相关文章

最新更新