升级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版本

相关推荐
Sheffield13 分钟前
Docker的跨主机服务与其对应的优缺点
linux·网络协议·docker
Sheffield8 小时前
Alpine是什么,为什么是Docker首选?
linux·docker·容器
舒一笑1 天前
程序员效率神器:一文掌握 tmux(服务器开发必备工具)
运维·后端·程序员
Johny_Zhao1 天前
centos7安装部署openclaw
linux·人工智能·信息安全·云计算·yum源·系统运维·openclaw
haibindev1 天前
在 Windows+WSL2 上部署 OpenClaw AI员工的实践与踩坑
linux·wsl2·openclaw
NineData1 天前
数据库管理工具NineData,一年进化成为数万+开发者的首选数据库工具?
运维·数据结构·数据库
梦想很大很大2 天前
拒绝“盲猜式”调优:在 Go Gin 项目中落地 OpenTelemetry 链路追踪
运维·后端·go
Sinclair2 天前
内网服务器离线安装 Nginx+PHP+MySQL 的方法
运维
叶落阁主2 天前
Tailscale 完全指南:从入门到私有 DERP 部署
运维·安全·远程工作