Python SSLError:sslv3 警报握手失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35405092/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 16:23:55  来源:igfitidea点击:

SSLError: sslv3 alert handshake failure

pythonsslopensslbranch.io

提问by Kumar Nitin

I'm making the following call to branch.io

我正在对 branch.io 进行以下调用

import requests
req = requests.get('https://bnc.lt/m/H3XKyKB3Tq', verify=False)

It works fine in my local machine but fails in the server.

它在我的本地机器上工作正常,但在服务器上失败。

SSLError: [Errno 1] _ssl.c:504: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

Openssl versions:

OpenSSL 版本:

local: OpenSSL 0.9.8zg 14 July 2015

本地:OpenSSL 0.9.8zg 2015 年 7 月 14 日

server: OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

服务器:OpenSSL 0.9.8e-fips-rhel5 2008 年 7 月 1 日

Python:

蟒蛇

local: 2.7.10 server: 2.7.6

本地:2.7.10 服务器:2.7.6

Branch io server connection:

分支 io 服务器连接

Chrome verified that DigiCert SHA2 Secure Server CA issued this website's certificate. The server did not supply any Certificate Transparency information.

Chrome 已验证 DigiCert SHA2 安全服务器 CA 颁发了该网站的证书。服务器未提供任何证书透明度信息。

I tried urllib2, but the result was same. Any help?

我试过 urllib2,但结果是一样的。有什么帮助吗?

采纳答案by Rahul

Jyo de Lyshas identified the problem. The problem is described hereand the solution is here. I did the following to get this working:

Jyo de Lys已经确定了问题所在。问题在此处描述,解决方案在此处。我做了以下工作来让这个工作:

  1. easy_install pyOpenSSL
  2. easy_install ndg-httpsclient
  3. easy_install pyasn1
  1. easy_install pyOpenSSL
  2. easy_install ndg-httpsclient
  3. easy_install pyasn1

If you're getting this error while using urllib2, you'll need to upgrade to python 2.7.9 or later too.

如果您在使用 urllib2 时遇到此错误,则您也需要升级到 python 2.7.9 或更高版本。