python easy_install 因所有包的 SSL 证书错误而失败

标签 python django ssl easy-install pypi

目标: 我正在使用 RedHat 5 并尝试为网络应用程序安装最新的 python 和 django。

我成功地安装了 python27 和 easy_install,以及带有 openssl 的 wget。

问题:但是,现在我尝试从 pypi.python.org 获取任何内容时,出现以下错误:

$ 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 查找 pypi.python.org 的证书,但不知道如何处理它,将它存储在哪里。谷歌资料不多,求高手帮忙。

谢谢!

编辑:我的意思是 wget* 和 openssl。

$ 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

我也无法让 wget 拉取页面:

$ 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'.

最佳答案

您的 curl 证书太旧尝试下载新的 curl 证书:

sudo wget http://curl.haxx.se/ca/cacert.pem -O /etc/pki/tls/certs/ca-bundle.crt

关于python easy_install 因所有包的 SSL 证书错误而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21265616/

相关文章:

python - 起始值和最小值/最大值之间的随机游走序列

python - Selenium 模拟鼠标滚轮下拉和 webdriverwait 替代 time.sleep

python - Python 中的正确列表和递归尾部

python - Django 中的外部 API 调用缓存

python - 如果任何列值不遵守 pandas 中的条件,则删除行

django - 将 SSL 添加到 Django 应用程序、Ubuntu 16+、DigitalOcean

Django:过滤 `DecimalField` 效果不佳?

带有 SSL 到特定证书的 Android 休息客户端

php - 如何使 php 真正与 https 站点一起工作?

android - 移动应用程序上的 HTTPS 证书续订