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