4

This may sound like the copy of this question but not only all the solutions do not work, but the question itself is pretty old and things may have changed in the mean time.

The following is my problem:

$ python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 0.9.8zg 14 July 2015
$ openssl version
OpenSSL 1.0.1e 11 Feb 2013

I am trying to run a python script which is telling me that "OpenSSL 0.9.8 is no longer supported". I installed OpenSSL as you can see, on my machine (OSX 10.10.5) it is the right version, but for some reason Python (2.7.12) references the old one. What to do?

Thanks

EDIT:

Let me add a couple of outputs so you all fella see that I followed all the instructions given in other StackOverflow topics:

$ which openssl
/opt/local/bin/openssl
$ openssl version
OpenSSL 1.0.1e 11 Feb 2013
$ brew update
Already up-to-date.
$ brew install openssl
Warning: openssl-1.0.2h_1 already installed
$ brew link --force openssl
Warning: Already linked: /usr/local/Cellar/openssl/1.0.2h_1
To relink: brew unlink openssl && brew link openssl
$ openssl version -a
OpenSSL 1.0.1e 11 Feb 2013
built on: Tue Feb 26 05:00:07 PST 2013
platform: darwin64-x86_64-cc
options:  bn(64,64) rc4(ptr,char) des(idx,cisc,16,int) idea(int) blowfish(idx) 
compiler: /usr/bin/clang -fPIC -fno-common -DOPENSSL_PIC -DZLIB  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
OPENSSLDIR: "/opt/local/etc/openssl"
$ brew install python --with-brewed-openssl   
Warning: python-2.7.12 already installed
$ sudo ln -s /usr/local/Cellar/python/2.7.8_2/bin/python /usr/local/bin/python
Password:
ln: /usr/local/bin/python: File exists
$ python --version
Python 2.7.12
$ python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 0.9.8zg 14 July 2015
Community
  • 1
  • 1
Masiar
  • 20,450
  • 31
  • 97
  • 140
  • [Updating openssl in python 2.7](http://stackoverflow.com/q/18752409), [Python referencing old SSL version](http://stackoverflow.com/q/24323858), [Python and OpenSSL version reference issue on OSX](http://stackoverflow.com/q/37690054), [How to upgrade OpenSSL in OS X?](http://apple.stackexchange.com/q/126830), etc... – jww Jul 19 '16 at 13:43
  • Yes, all were known resources. I edited the post so that you can see the output of my console for all the commands listed in the solutions provided. – Masiar Jul 19 '16 at 14:18
  • It appears you have not followed `brew unlink openssl` and subsequent relinks. What does `otool -L` tell you about the image's libraries? And what do you get when you enable [dyld debug messages](https://developer.apple.com/library/mac/technotes/tn2124/_index.html#//apple_ref/doc/uid/DTS10003391-CH1-SECDYLD)? – jww Jul 19 '16 at 22:09

0 Answers0