Python引用旧的OpenSSL

时间:2016-07-19 10:17:32

标签: python macos openssl

这可能听起来像this问题的副本,但不仅所有解决方案都不起作用,而且问题本身已经很老了,而且事情可能在同一时间发生了变化。

以下是我的问题:

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

我正在尝试运行一个python脚本,告诉我" OpenSSL 0.9.8不再受支持"。我可以看到,我在我的机器(OSX 10.10.5)上安装了OpenSSL,它是正确的版本,但由于某种原因,Python(2.7.12)引用了旧版本。怎么办?

由于

编辑:

让我添加几个输出,这样你们都会看到我遵循其他StackOverflow主题中给出的所有说明:

$ 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

0 个答案:

没有答案
相关问题