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

相关推荐
少妇的美梦1 天前
logstash教程
运维
chen9451 天前
k8s集群部署vector日志采集器
运维
chen9451 天前
aws ec2部署harbor,使用s3存储
运维
轻松Ai享生活1 天前
5 节课深入学习Linux Cgroups
linux
christine-rr1 天前
linux常用命令(4)——压缩命令
linux·服务器·redis
三坛海会大神5551 天前
LVS与Keepalived详解(二)LVS负载均衡实现实操
linux·负载均衡·lvs
東雪蓮☆1 天前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
qq_264220891 天前
LVS负载均衡群集和LVS+Keepalived群集
运维·负载均衡·lvs
乌萨奇也要立志学C++1 天前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
雨落Liy1 天前
Nginx 从入门到进阶:反向代理、负载均衡与高性能实战指南
运维·nginx·负载均衡