You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wget https://www.openssl.org/source/openssl-3.0.10.tar.gz --no-check-certificate
tar zvxf openssl-3.0.10.tar.gz
cd openssl-3.0.10
./config --prefix=/usr/local/software/openssl-3.0.10 shared zlib
make && make install
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
很多人在使用 Python3 经常会遇到一些 openssl 版本太低从而导致包无法正常使用的问题,尤其是
urllib3
这个包。网络上有很多关于这方面的教程,主要解决方案:
urllib3
的版本,例如:pip install --upgrade urllib3==1.26.15
;个人觉得这两个方法都不够好,尤其是第二个方法 ——
--with-openssl
指定了新装的 OpenSSL 路径,编译安装完成后 Python 仍然使用旧版本的 OpenSSL;很不幸的是,个人在 CentOS 7.3 + Python-3.9.18 就遇到了这个问题。
~/.bashrc
环境变量等编译完成后,你会神奇的发现重新编译安装后 Python 3.9.18 仍然使用旧版本的 OpenSSL (OpenSSL 1.0.2k-fips 26 Jan 2017)!
其实,这还是因为 Python 在重新编译的时候没有识别到新编译的 OpenSSL,因此,我们需要把重新编译的命令调整一下:
这样子一来,问题就迎刃而解了,编译安装完后,你会发现 Python 3.9.18 已经成功用用上了 OpenSSL 3.0.10 1 Aug 2023:
参考资料
Beta Was this translation helpful? Give feedback.
All reactions