一、升级 openssl
下载:
wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
安装:
[root@live src]#tar -zxvf openssl-1.1.1a.tar.gz
[root@live src]# cd openssl-1.1.1a
[root@live openssl-1.1.1a]# ./config --prefix=/usr/local/openssl shared zlib-dynamic
[root@live openssl-1.1.1a]# make && make install
[root@live openssl-1.1.1a]# mv /usr/bin/openssl /usr/bin/openssl.old
[root@live openssl-1.1.1a]# mv /usr/include/openssl /usr/include/openssl_old
[root@live openssl-1.1.1a]# ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
[root@live openssl-1.1.1a]# ln -s /usr/local/openssl/include/openssl/ /usr/include/openssl
[root@live openssl-1.1.1a]# echo "/usr/local/openssl/lib/" >> /etc/ld.so.conf
[root@live openssl-1.1.1a]# ldconfig
二、安装Python3.8 及以上版本
yum install zlib zlib-devel libffi-devel -y
https://www.python.org/ftp/python/3.8.7/Python-3.8.7.tgz
tar -zxvf Python-3.8.7.tar.xz
xz -d Python-3.8.7.tar.xz
tar -xf Python-3.8.7.tar
cd Python-3.8.7
./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl
make all && make install
# ln -s /usr/local/python3/bin/python3 /usr/bin/python3
# ln -s /usr/local//python3/bin/pip3 /usr/bin/pip3