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

相关推荐
jerryinwuhan4 小时前
《系统部署与运维》开篇 课程介绍
运维
ltl6 小时前
实时 OS 巡礼:VxWorks、QNX、Zephyr 与 PREEMPT_RT
linux
我是谁??6 小时前
Ubuntu22.04更换清华源
linux·运维·服务器
圣殿骑士-Khtangc6 小时前
Go字符串高效拼接性能对比与底层原理分析
服务器·前端·golang
Shell运维手记7 小时前
Linux 常用基础命令学习笔记
linux·运维·笔记·学习·算法·github
朴马丁7 小时前
国际与国产PLM在精细化工赛道的布局:2026年主要厂商技术特色
大数据·运维·人工智能·流程行业plm·化工新材料
这个DBA有点耶7 小时前
数据库一体机架构演进:从硬件堆叠到软硬深度耦合
服务器·网络·数据库·硬件架构·运维开发·database·数据库架构
Elastic 中国社区官方博客8 小时前
Elasticsearch:使用 AI Agent 来创建 workflow
大数据·运维·人工智能·elasticsearch·搜索引擎·自动化·全文检索
测试运维日常笔记8 小时前
Linux系统安装配置TigerVNC服务器完整指南
linux·运维·服务器
像风一样自由20208 小时前
加强版VScode结合remote-ssh远程连接服务器开发指南
服务器·vscode·ssh