首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >所有包的SSL证书错误导致easy_install失败。

所有包的SSL证书错误导致easy_install失败。
EN

Stack Overflow用户
提问于 2014-01-21 17:54:28
回答 4查看 23.8K关注 0票数 15

目标:,我在RedHat 5上,试图为一个web应用程序安装最新的python。

我成功地安装了python27和easy_install,并使用openssl实现了wget。

问题:,但是,现在我试图从pypi.python.org获得任何信息,我得到了以下错误:

代码语言:javascript
复制
$ sudo easy_install --verbose django
Searching for django
Reading https://pypi.python.org/simple/django/
Download error on https://pypi.python.org/simple/django/: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed -- Some packages may not be found!
Couldn't find index page for 'django' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed -- Some packages may not be found!
No local packages or download links found for django
error: Could not find suitable distribution for Requirement.parse('django')

我试着用openssl s_client -showcert -connect查找s_client的证书,但是不知道如何处理它,在哪里存储它。谷歌的信息不多,需要专家的帮助。

谢谢!

编辑:我指的是使用openssl的wget*。

代码语言:javascript
复制
$ wget http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
$ tar -xzf wget-1.15.tar.gz
$ cd wget-1.15
$ ./configure --with-ssl=openssl
$ make
$ sudo make install

我也找不到人来翻开这页:

代码语言:javascript
复制
$ wget https://pypi.python.org/simple/django/
--2014-01-21 11:18:45--  https://pypi.python.org/simple/django/
Resolving pypi.python.org (pypi.python.org)... 199.27.73.185, 199.27.74.184
Connecting to pypi.python.org (pypi.python.org)|199.27.73.185|:443... connected.
ERROR: cannot verify pypi.python.org's certificate, issued by ‘/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3’:
  Unable to locally verify the issuer's authority.
To connect to pypi.python.org insecurely, use `--no-check-certificate'.
EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2015-06-09 09:45:38

您的curl证书太旧了,请下载新的curl证书:

代码语言:javascript
复制
sudo wget http://curl.haxx.se/ca/cacert.pem -O /etc/pki/tls/certs/ca-bundle.crt
票数 16
EN

Stack Overflow用户

发布于 2014-06-01 19:37:04

我在寻找这个问题的解决方案后找到了这个页面。如果其他人有类似的问题,我发现的解决方案是:

setuptools/ssl_support.py文件的开头(由easy_install使用,在egg文件:./lib/python2.7/site-packages/setuptools-3.5.1-py2.7.egg中),证书包文件在cert_paths变量中进行了硬编码:

代码语言:javascript
复制
cert_paths = """
/etc/pki/tls/certs/ca-bundle.crt
/etc/ssl/certs/ca-certificates.crt
/usr/share/ssl/certs/ca-bundle.crt
/usr/local/share/certs/ca-root.crt
...etc..
"""

easy_install将使用该列表中存在的第一个文件,如它所调用的find_ca_bundle。如果此cert文件中的证书过期,则easy_install将因此SSL错误而失败。因此,需要更新证书文件或更改此ssl_support.py文件中的ssl_support.py,以指向本地最新的证书包文件。

票数 9
EN

Stack Overflow用户

发布于 2015-06-04 11:11:41

我在一个特定的环境中看到了这个问题: Mac带有macports,在用户的本地路径上安装软件包。解决方案是从curl安装证书:

代码语言:javascript
复制
port install curl-ca-bundle

顺便说一句,除非您没有证书,否则大多数porteasy_installpip命令都会因为ssl错误而失败。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21265616

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档