查看原來openssl的版本
openssl version -a
|
OpenSSL 1.0.2k-fips 26 Jan 2017
built on: reproducible build, date unspecified
platform: linux-x86_64
options: bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
OPENSSLDIR: "/etc/pki/tls"
engines: rdrand dynamic
、
下載新的包
wget https://www.openssl.org/source/openssl-1.1.1s.tar.gz
下載有點慢啊,酌情考慮使用國內(nèi)源鏡像吧。
安裝
# 編譯代碼會用到的一些依賴
yum install -y zlib zlib-devel gcc
tar -xvf openssl-1.1.1s.tar.gz
cd openssl-1.1.1s
./config shared --prefix=/usr/local/ssl
make && make install
增加配置并使其生效
echo "/usr/local/lib64/" >> /etc/ld.so.conf
ldconfig -v
鏈接新版本
# 舊版本先備份一下
mv /usr/bin/openssl /usr/bin/openssl.bak
# 鏈接到安裝位置的可執(zhí)行文件
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
最后查看openssl版本驗證。
openssl version
|
OpenSSL 1.1.1s 1 Nov 2022
因為ssl的1.0.2已經(jīng)無法支持高版本的python,為了防止后面使用pip的時候出現(xiàn)問題,必須做一個升級。
現(xiàn)在重新編譯安裝python3.10
下載的步驟就省略了,這里要配置上剛剛ssl的安裝路徑,編譯的時候才可以鏈接到ssl正確的包:
# 如果前面執(zhí)行pip發(fā)現(xiàn)已經(jīng)入坑,清理一下重新編譯安裝
make clean
./configure --with-openssl=/usr/local/ssl
make && make install
如愿以償,不會再報ssl證書的問題了。文章來源:http://www.zghlxwxcb.cn/news/detail-656925.html
—END—文章來源地址http://www.zghlxwxcb.cn/news/detail-656925.html
到了這里,關(guān)于centos7.9升級openssl以解決pip安裝過程中的問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!