【发布时间】:2021-10-10 14:54:12
【问题描述】:
对于我的一个项目,我需要最新版本的 SSL 证书。
这就是我所拥有的:
python3 --version
Python 3.8.6
openssl version
OpenSSL 1.1.1f 31 Mar 2020
python3 -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.0.2g 1 Mar 2016
python3 -m OpenSSL.debug
pyOpenSSL: 21.0.0
cryptography: 35.0.0
cffi: 1.14.4
cryptography's compiled against OpenSSL: OpenSSL 1.1.1l 24 Aug 2021
cryptography's linked OpenSSL: OpenSSL 1.1.1l 24 Aug 2021
Python's OpenSSL: OpenSSL 1.0.2g 1 Mar 2016
Python executable: /usr/bin/python3
Python version: 3.8.6 (default, Oct 6 2020, 04:02:53)
[GCC 5.4.0 20160609]
Platform: linux
sys.path: ['/opt/programs', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/local/lib/python3.8/dist-packages/pip-21.0.1-py3.8.egg', '/usr/lib/python3/dist-packages']
我认为这就是问题
Python's OpenSSL: OpenSSL 1.0.2g 1 Mar 2016
所以我创建了一个新的虚拟环境和 pyOpenSSL 并再次检查 SSL
python3 -c 'import ssl; print(ssl.OPENSSL_VERSION)'
OpenSSL 1.0.2g 1 Mar 2016
python3 -m OpenSSL.debug
pyOpenSSL: 21.0.0
cryptography: 35.0.0
cffi: 1.14.6
cryptography's compiled against OpenSSL: OpenSSL 1.1.1l 24 Aug 2021
cryptography's linked OpenSSL: OpenSSL 1.1.1l 24 Aug 2021
Python's OpenSSL: OpenSSL 1.0.2g 1 Mar 2016
Python executable: /opt/parsers/env4/bin/python3
Python version: 3.8.6 (default, Oct 6 2020, 04:02:53)
[GCC 5.4.0 20160609]
Platform: linux
sys.path: ['/opt/programs', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/opt/parsers/env4/lib/python3.8/site-packages']
我也看到了同样的问题: Python 的 OpenSSL:OpenSSL 1.0.2g 2016 年 3 月 1 日
如何更新 Python 的 OpenSSL?
【问题讨论】:
-
我的 python (3.8.10) 给出:`python3 -c 'import ssl; print(ssl.OPENSSL_VERSION)' -> OpenSSL 1.1.1f 31 Mar 2020' 也许你应该升级你的 python 版本。
-
是的,我将安装 python 3.9,其上的 Python 的 SSL 是“OpenSSL 1.1.1f 31 Mar 2020”,但现在我无法使用 python 3.9 创建新环境
标签: python python-3.x linux ssl openssl