在python 2.7中更新OpenSSL

在python 2.7中更新OpenSSL

想知道是否有人可以解释OpenSSL在python2.7中是如何工作的。我不确定python是否有自己的OpenSSL,还是从本地机器/env中获取?


让我解释一下:(如果我用Python来做这件事)


>>> import ssl

>>> ssl.OPENSSL_VERSION

'OpenSSL 0.9.8x 10 May 2012'

(在终点站)


$ openssl version

OpenSSL 0.9.8x 10 May 2012

$ which openssl 

/usr/bin/openssl

现在我更新了OpenSSL(下载)。


$ cd openssl-1.0.1c

$ ./Configure darwin64-x86_64-cc --prefix=/usr --openssldir=/opt/local/etc/openssl shared

$ make

$ sudo make install

这创建了单独的指令(如指定的那样),因此我将其复制到旧路径中。


cp -f /usr/local/ssl/bin/openssl /usr/bin/openssl

现在,在终端,OpenSSL版本已经更新,但不是从python!


$ openssl version

OpenSSL 1.0.1c 10 May 2012

我确实注意到.dylib仍然指向旧版本,如何更改它?


$ ls -l /usr/lib/*ssl*

-rwxr-xr-x  1 root  wheel  411680 Jul 17  2012 /usr/lib/libssl.0.9.7.dylib

-rwxr-xr-x  1 root  wheel  602800 May 24 03:43 /usr/lib/libssl.0.9.8.dylib

-rwxr-xr-x  1 root  wheel  390908 Sep  9 17:37 /usr/lib/libssl.1.0.0.dylib

lrwxr-xr-x  1 root  wheel      18 Jul 17  2012 /usr/lib/libssl.dylib -> libssl.0.9.8.dylib

更新:我更改了链接,但在python上仍然有旧版本。


$ ls -l /usr/lib/*ssl*

-rwxr-xr-x  1 root  wheel  411680 Jul 17  2012 /usr/lib/libssl.0.9.7.dylib

-rwxr-xr-x  1 root  wheel  602800 May 24 03:43 /usr/lib/libssl.0.9.8.dylib

-rwxr-xr-x  1 root  wheel  390908 Sep  9 17:37 /usr/lib/libssl.1.0.0.dylib

lrwxr-xr-x  1 root  wheel      18 Sep 11 15:47 /usr/lib/libssl.dylib -> libssl.1.0.0.dylib


慕哥6287543
浏览 1361回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python