升级openssl与python问题

1、下载与安装

wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1t.tar.gz

tar -zxvf openssl-1.1.1t.tar.gz

cd openssl-1.1.1t/

./config --prefix=/usr/local/ssl

make

sudo make install

2、完成后添加软链接

mv /usr/bin/openssl /usr/bin/oldopenssl

ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl

ln -s /usr/local/ssl/lib/libssl.so.1.1 /usr/lib64/

ln -s /usr/local/ssl/lib/libcrypto.so.1.1 /usr/lib64/

3、验证

openssl version

4、python中报错

Traceback (most recent call last):

File "salt.py", line 1, in <module>

import requests

File "/home/tianqiurong.vendor/.local/lib/python3.8/site-packages/requests/init.py", line 43, in <module>

import urllib3

File "/home/tianqiurong.vendor/.local/lib/python3.8/site-packages/urllib3/init.py", line 42, in <module>

raise ImportError(

ImportError: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips 26 Jan 2017'. See: https://github.com/urllib3/urllib3/issues/2168

解决方式如下:

pip install urllib3==1.26.15

小知识

python -c "import ssl; print(ssl.OPENSSL_VERSION)" #查看python中使用的ssl版本

相关推荐
忆挽篱笙歌几秒前
gdb/cgdb
linux·ubuntu
甜到心里的蛋糕7 分钟前
Playwright 无头浏览器自动发布 CSDN 图文草稿的实践(持久化 profile + 图床直传)
运维·python·playwright·爬虫自动化·博客运营
fei_sun1 小时前
RIB、FIB、MAC 、ARP 表
服务器·网络·macos
凌云若寒1 小时前
BarTender提示#807错误:无法在拥有其他许可证的Licensing Service上激活节点锁定的 Professional 版许可证 的解决办法
运维·服务器·前端·学习·软件需求
Julien20041 小时前
管理 Ansible 配置文件
linux·运维·服务器·ssh·学习方法
逐米时代1 小时前
远程运维诊断减少到场率
java·服务器·前端
pt10431 小时前
CML网络仿真入门-6(结):Cisco Modeling Labs 示例拓扑
服务器·网络
MicrosoftCloud2 小时前
性能排查 01|free 显示内存用了 90% 就是快满了吗?buff/cache 与 available 一次讲清
linux·运维·内存·free·buff/cache
灯澜忆梦2 小时前
【docker】#1 | Docker 初识
运维·docker·容器
风寄巴山秋2 小时前
OpenBMC:Web 页面功能异常排查
运维·服务器·前端·架构