1

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.

jww
  • 97,681
  • 90
  • 411
  • 885
user2989813
  • 283
  • 1
  • 5
  • 16
  • I am looking inside modules/setup.dist and see the following. Is this what I need to modify? How would I do so? # Socket module helper for SSL support; you must comment out the other # socket line above, and possibly edit the SSL variable: #SSL=/usr/local/ssl #_ssl _ssl.c \ # -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ # -L$(SSL)/lib -lssl -lcrypto – user2989813 Jan 18 '17 at 12:22
  • [How do I install pyOpenSSL on Mac OS X?](http://stackoverflow.com/q/14361569), [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 OS X](http://stackoverflow.com/q/37690054), [Python 3.3 and Installing PyOpenSSL on a Mac](http://stackoverflow.com/q/21899573), [Using Python with homebrew on OS X](http://stackoverflow.com/q/25441252), etc... – jww Jan 19 '17 at 02:28

0 Answers0