1

Our devops recently turned on SSL on our in-house ElasticSearch servers, while our Ubuntu dev boxes are connecting to it fine, but it's causing SSLError on Mac dev boxes (running Django).

SSLError at /search
ConnectionError(EOF occurred in violation of protocol (_ssl.c:590)) caused by: SSLError(EOF occurred in violation of protocol (_ssl.c:590))

What I know so far:

  • Not limited to El Capitan, also breaks on earlier version
  • We can connect to other ES service over https, our devops told me our ES service has higher https requirements
  • Openssl v0.9.8 has handshake problem on the ES service
  • Openssl v1.0.1 works fine on the ES service

There are many posts online around this problem but none helped.

I have tried:

  • brew link --force openssl (but EL Capitan is stopping it), none of the solutions worked from Homebrew refusing to link OpenSSL
  • adding /usr/local/opt/openssl/lib to DYLD_LIBRARY_PATH
  • upgrading python from 2.7.10 to 2.7.12
  • rebuilding virtualenv

None of the above worked...

Questions:

  • Is it due to OpenSSL version?
  • Is it due to Python version due to _ssl.c?
  • How do I fix this?
Community
  • 1
  • 1
James Lin
  • 25,028
  • 36
  • 133
  • 233

1 Answers1

1

Finally nailed it, basically you will have to install Python that has updated openssl

check in Python cmd

import ssl
print ssl.OPENSSL_VERSION

It should print 0.9.x

Now to update:

  1. brew install openssl, don't worry about the linking if it rejects, make sure it's >=1.x.x
  2. 'brew install python --with-brewed-openssl`
  3. recreate virtualenv by specifying the brewed version of Python, eg. mkvirtualenv --python=/usr/.../Cellar/python/bin/python <project>
James Lin
  • 25,028
  • 36
  • 133
  • 233