2

OSX El Capitan V10.11.5

I'm trying to resolve this error:

SSLError('bad handshake', Error([('SSL routines', 'SSL23_GET_SERVER_HELLO', 'sslv3 alert handshake failure')]

And I believe this is the cause as per https://github.com/superfell/Beatbox:

Note that if you're on OSX, its bundled with an older version of openSSL than is required. If you see an error similar to ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure or UNSUPPORTED_CLIENT: TLS 1.0 has been disabled in this organization. Please use TLS 1.1 or higher when connecting to Salesforce using https. you need to update your python and/or OpenSSL versions.

This issue persists inside and outside my virtual environment. In the terminal:

(virtualenv)sav> openssl version -v
OpenSSL 1.0.2g  1 Mar 2016

(virtualenv)sav> python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 0.9.8zh 14 Jan 2016

In a python terminal:

import ssl
ssl?

Type:        module
String form: <module 'ssl' from '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.pyc'>
File:        /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py
Docstring:

And in /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py:

import _ssl             # if we can't import it, let the error propagate
from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION

_ssl is imported from ~/Envs/virtualenv/lib/python2.7/lib-dynload/_ssl.so which is a C shared object file. And then I pretty much hit a wall.

I think my bug will be fixed if I can point ssl to OpenSSL 1.0.2 instead of 0.9.8 but I'm not sure where to make that change. Have you dealt with this? Happy to provide more information.

Thanks

suavesav
  • 43
  • 5
  • I was using Python2.7.10. – suavesav Jul 18 '16 at 18:45
  • The link to the duplicate question helped. Installed a brewed python and linked linked it to my virtualenv – suavesav Jul 18 '16 at 18:47
  • Could you point out the steps on how you linked a the new version on openssl with your virtual env? I got python 3.5 and want to use it in venv but no matter what I do my venv uses ssl 0.9.8zg which throws errors when I try and use a few modules – Beginner Aug 25 '16 at 18:04
  • I went pretty far down the rabbit hole on this one. This is what I did: https://gist.github.com/suavesav/5aef95a45ab136784523591128474bfe Hope it helps. Let me know if you have any other questions @newkid101 – suavesav Aug 26 '16 at 22:52
  • See SOLVED NO HACKS answer: https://stackoverflow.com/questions/18752409/updating-openssl-in-python-2-7/46238598#46238598 – Paul Kenjora Sep 15 '17 at 11:35

0 Answers0