1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| # root用户
export OpensslVersion="1.1.1q"
umask 002
yum install gcc gcc-c++ -y
# 下载最新版
cd /usr/local/src/
curl -k https://www.openssl.org/source/openssl-${OpensslVersion}.tar.gz -o openssl-${OpensslVersion}.tar.gz
# 解压
tar xf openssl-${OpensslVersion}.tar.gz
# 编译安装
cd openssl-${OpensslVersion}
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl '-Wl,-rpath,$(LIBRPATH)'
make -j4 && make install
# 备份老版本
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak
# 软连接新版本
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf.d/openssl-x86_64.conf
ldconfig -v
# 检查版本
openssl version -a
|