Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSLError: sslv3 alert handshake failure

I'm making the following call to 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:

local: OpenSSL 0.9.8zg 14 July 2015

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

Python:

local: 2.7.10 server: 2.7.6

Branch io server connection:

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

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

like image 567
Kumar Nitin Avatar asked Feb 15 '16 08:02

Kumar Nitin


People also ask

What happens when TLS handshake fails?

If the TLS/SSL handshake succeeds, then the TLS/SSL client and server transfer data to each other securely. Otherwise, if a TLS/SSL handshake failure occurs the connection is terminated and the client receives a 503 Service Unavailable error. The protocol used by the client is not supported by the server.

What is a TLS issue?

This SSL/TLS Handshake Failed Error occurs whenever the OS hasn't granted the read access to the OS, ultimately preventing the complete authentication of the webserver, which indicates that the browser's connection with the web server is not secure.


1 Answers

Jyo de Lys has identified the problem. The problem is described here and the solution is here. I did the following to get this working:

  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.

like image 146
Rahul Avatar answered Sep 22 '22 12:09

Rahul