python2.7更新_在python 2.7中更新openssl

想知道是否有人可以解释openssl如何在python2.7中工作。我不确定python是否拥有自己的openssl或从本地计算机/环境中获取它?

让我解释一下:(如果我使用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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值