【发布时间】:2018-04-28 15:55:05
【问题描述】:
我正在尝试为在 MacOS El Capitan 上运行的 Python 3.5 更新 OpenSSL。我已经通过这个命令安装了新版本:
brew install openssl
我在 shell 上得到了以下信息:
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local.
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
==> Summary
???? /usr/local/Cellar/openssl/1.0.2g: 1,678 files, 12.0M
然后,我检查 shell 上的版本:
$ python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 0.9.8zh 14 Jan 2016
$ openssl version
OpenSSL 1.0.2o 27 Mar 2018
OpenSSL 似乎有两个版本,Python 继续使用最旧的版本。我需要获取更新版本的 OpenSSL 来运行 Python 程序,但我不知道如何让 Python 使用最新版本。我也不知道如何使用 brew 安装新版本后提供的信息。
任何帮助将不胜感激!
【问题讨论】: