python - gsutil ssl.SSLError : [Errno 185090050]

标签 python ssl google-cloud-storage gsutil

我试图让 gsutil 在我的机器上运行,但它总是失败并出现以下错误:

ssl.SSLError: [Errno 185090050] _ssl.c:358: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

关于其他 python 应用程序的此错误有很多帖子,其中解决方案涉及编辑源代码。如果源代码是问题所在,那么 gsutil 开发人员需要了解它,但他们不会宣传用户如何发布错误。

我可能在安装 gsutil 时犯了错误。也许我需要获得证书并进行设置?但我不知道该怎么做。

我确实设法通过在 .boto 文件中禁用服务器身份验证来解决这个问题。但是为了安全起见,我更愿意进行身份验证。

希望有人能帮我解决这个问题。

最佳答案

部分更新将解决问题

方法一 如果您使用 gsutil 源代码,那么

只更新httplib2包 https://github.com/httplib2/httplib2

或者

仅更新 httplib2 包内的证书 https://github.com/httplib2/httplib2/blob/master/python2/httplib2/cacerts.txt

方法二

指定系统证书到boto.xt文件 https://github.com/fout/fout/blob/master/review/google_snippet_status/templates/boto.xt

https_validate_certificates = True
ca_certificates_file = /etc/ssl/certs/ca-bundle.crt

引用:http://boto.cloudhackers.com/en/latest/boto_config_tut.html

**注意:** 就我而言: 如果我使用像“ca_certificates_file = system”这样的系统,它会给出一些套接字错误

    Caught socket error, retrying: [Errno 185090050] _ssl.c:330: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
Retrying request to url <https://www.googleapis.com/storage/v1/b/adx-rtb-freakout-vd/o?   projection=full&prettyPrint=True&versions=False&fields=prefixes%2CnextPageToken%2Citems%2Fname&prefix=snippet_status&maxResults=500&delimiter=%2F&alt=json> after  connection break.
Caught socket error, retrying: [Errno 185090050] _ssl.c:330: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

正在重试对 url https://www.googleapis.com/storage/v1/b/adx-rtb-freakout-vd/o?projection=full&prettyPrint=True&versions=False&fields=prefixes%2CnextPageToken%2Citems%2Fname&prefix=snippet_status&maxResults=500&delimiter=%2F&alt=json 的请求连接中断后。

注意:最好使用最新的 gsutil 和 Python 2.7.X

关于python - gsutil ssl.SSLError : [Errno 185090050],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31844779/

相关文章:

apache - 多个虚拟主机的一个 IP 地址和通配符证书(Windows、Apache 2.4.2、OpenSSL 1.0.2e)

ios - 带有 http 请求的 https 适用于 ios 移动设备,而不是桌面设备?

amazon-s3 - 如何使用 Google Cloud Storage 隐藏真实 URL?

google-cloud-storage - 谷歌云存储获取下载链接

python - 模块未找到错误: No module named 'mport pandas as pd\r'

Python:日期时间格式

python - 主菜单帮助(pygame)

amazon-web-services - 如何在新子域(跨 AWS 账户)上创建和验证 AWS 公共(public)证书?

google-cloud-platform - 如何从我的 Google Developers Console 识别 Google Cloud Storage URI?

python - 为什么 Python 不抛出溢出错误?