#---------------------------------------------------------------------------
openssl C++ library
https://www.openssl.org/source/index.html
#---------------------------------------------------------------------------
cd /opt/download
下载openssl-3.0.13 (LTS)
wget https://www.openssl.org/source/openssl-3.0.13.tar.gz
解压到/opt/openssl中
tar -zxvf openssl-3.0.13.tar.gz --C /opt/openssl
安装
mkdir install
cd /opt/openssl/openssl-3.0.13
./config --prefix=/opt/openssl/install
make -j $(nproc)
make install
安装成功后,您可以在系统中查找OpenSSL
ls /opt/openssl/install/bin/
创建include及lib的链接:
ln -sf /opt/openssl/install/lib64/pkgconfig/libcrypto.pc /usr/local/lib/pkgconfig/libcrypto.pc
ln -sf /opt/openssl/install/lib64/pkgconfig/libssl.pc /usr/local/lib/pkgconfig/libssl.pc
ln -sf /opt/openssl/install/lib64/pkgconfig/openssl.pc /usr/local/lib/pkgconfig/openssl.pc
ln -sf /opt/openssl/install/include/openssl /usr/local/include/openssl
ln -sf /opt/openssl/install/lib64/libcrypto.so /usr/local/lib/libcrypto.so
ln -sf /opt/openssl/install/lib64/libssl.so /usr/local/lib/libssl.so
#配置环境变量让系统自动识别OpenSSL
vim /etc/profile
export PATH=$PATH:/opt/openssl/install/bin
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openssl/install/lib
source /etc/profile
查看penSSL版本
openssl version -a