SSLError on HTTPie. Directly using Requests works. #204

Closed
edufelipe opened this Issue Feb 21, 2014 · 8 comments

6 participants

@edufelipe

I'm getting SSL errors when connecting to some sites using HTTPie. When I manually connect to them using requests the error does not manifest itself.

$ http 'https://app.onsign.tv/accounts/login/'
http: error: SSLError: [Errno bad handshake] [('SSL routines', 'SSL23_GET_SERVER_HELLO', 'sslv3 alert handshake failure')]

$ python
Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> r = requests.get('https://app.onsign.tv/accounts/login/')
>>> r.status_code
200

$ pip freeze
Pygments==1.6
httpie==0.8.0
requests==2.2.1
wsgiref==0.1.2
@sigmavirus24

I'm not seeing an issue:

~ http https://app.onsign.tv/accounts/login
HTTP/1.1 301 MOVED PERMANENTLY
Connection: keep-alive
Content-Language: en
Content-Length: 0
Content-Type: text/html; charset=utf-8
Date: Sat, 22 Feb 2014 01:12:01 GMT
Location: https://app.onsign.tv/accounts/login/
Server: nginx/1.1.19
Strict-Transport-Security: max-age=31536000
Vary: Accept-Language



What is the result of: python -c 'import ssl; print(ssl.OPENSSL_VERSION)'?

@jkbrzt
Owner

No problem here either.

@maedox

Works for me too.

Looks good to SSL Labs too: https://www.ssllabs.com/ssltest/analyze.html?d=app.onsign.tv

@edufelipe

@maedox Did you try this from OS X 10.9.2?

$ openssl version
OpenSSL 0.9.8y 5 Feb 2013
$ python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 0.9.8y 5 Feb 2013
@jkbrzt
Owner

@edufelipe I have the exact same versions and am unable to reproduce it.

@jkbrzt
Owner

I'm closing this for now. Please feel free to reopen if you have some new details.

@jkbrzt jkbrzt closed this Apr 7, 2014
@njbraun

If someone runs into this, performing the following fixes it:

sudo apt-get install libffi-dev
pip install pyOpenSSL ndg-httpsclient pyasn1

kennethreitz/requests#2022 (comment)

@k0pernikus

I was also having the error not entirely unlike this:

http: error: SSLError: [Errno bad handshake] [('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')]

and google led me here. In my case I just forgot that I had a self-signed certificate, so adding --verify no argument made the call work.

There may be a hidden feature request inside here, namely: Making the error message a bit more human readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment