1. Upgrade openssl version - compile and install
Download the OpenSSL file from the official website
https://www.openssl.org/source/openssl-1.1.1n.tar.gz
2. Unzip and compile after downloading
cd software
tar -zxvf openssl-1.1.1n.tar.gz
cd openssl-1.1.1n
./config --prefix=/usr/local/openssl
make
make install
3. Modify the link file
备份原有链接
mv /usr/bin/openssl /usr/bin/openssl.bak
创建软链接
ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl
4. Add the path to ld.so.conf
Note: There is no "/" at the end of the path, otherwise an error will be reported
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
5. The settings take effect
ldconfig -v
6. View the OpenSSL version
openssl version
OpenSSL 1.1.1n 15 Mar 2022
7. Pay attention! Notice! Notice! There are 2 methods here:
1、
Modify the Module/Setup link of the Python compiled source file as follows:
The path on line 211 is changed to the path compiled by OpenSSL,
Pages 212-214 uncommented.
as follows:
210 socket line above, and edit the OPENSSL variable:
211 OPENSSL=/usr/local/openssl
212 _ssl _ssl.c \
213 -I$(OPENSSL)/include -L$(OPENSSL)/lib \
214 -lssl -lcrypto
Note: Everyone's file may be different, please refer to your own.
Recompile the Python source file after modification.
./configure --prefix=/usr/local/python310
make && make install
2. Use parameters with ssl during installation
./configure --prefix=/usr/local/python3.10 --with-openssl=/usr/local/openssl --with-openssl-rpath=auto
make && make install