I have two versions of Python: 2.7 (manually installed) and 3.4 (installed with Homebrew). I am using Python 2.7 with Django and cannot switch to a more recent Python for Django compatibility reasons.
My Python 2.7 is still using an old version of OpenSSL. I have already downloaded a newer OpenSSL, and it is linked to Python 3.4. Here is proof:
$ openssl version -a
OpenSSL 1.0.2j 26 Sep 2016
built on: reproducible build, date unspecified
platform: darwin64-x86_64-cc
options: bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: clang -I. -I.. -I../include -fPIC -fno-common -DOPENSSL_PIC -DZLIB_SHARED -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 -DECP_NISTZ256_ASM
OPENSSLDIR: "/usr/local/etc/openssl"
How can I link this new version of OpenSSL to my old Python 2.7?
I have read many similar questions, but the answers all suggest installing a new version of python that comes with the latest SSL, whereas I want to change the version of SSL used by my old python 2.7.