openssl 升级 操作

   好多公司都会用绿盟扫描系统漏洞,里边就会涉及到ssl 漏洞,原因是openssl 版本低导致,会让你升级到指定版本。下面就介绍一下openssl 版本升级的操作方案。

一. 查看系统版本

[root@jxhdkt ~]# cat /etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

 

二. 查看原系统openssl 版本

[root@jxhdkt ~]# 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_REE

NTRANT -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_ASMOPENSSLDIR: "/etc/pki/tls"

engines:  rdrand dynamic

 

[root@jxhdkt soft]# rpm -qf `which openssl`

openssl-1.0.2k-8.el7.x86_64

 

 三. 根据漏洞扫描要求配置新版本openssl -- openssl-1.1.0h.tar.gz

Openssl 下载地址:https://www.openssl.org/source/

 

[root@jxhdkt soft]# ls openssl-1.1.0h.tar.gz

openssl-1.1.0h.tar.gz

 

[root@jxhdkt soft]# tar xf openssl-1.0.2l.tar.gz -C /usr/src/

[root@jxhdkt soft]#  cd /usr/src/openssl-1.0.2l/

[root@jxhdkt openssl-1.1.0h]# ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib shared zlib-dynamic

[root@jxhdkt openssl-1.1.0h]# make depend

[root@jxhdkt openssl-1.1.0h]#  make && make install

 

# 拷贝so库到指定位置

[root@jxhdkt openssl-1.1.0h]# cp /usr/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1

[root@jxhdkt openssl-1.1.0h]# cp /usr/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1

 

四. 查看升级后版本

[root@jxhdkt openssl-1.1.0h]# openssl version -a

OpenSSL 1.1.0h  27 Mar 2018

built on: reproducible build, date unspecified

platform: linux-x86_64

options:  bn(64,64) rc4(16x,int) des(int) idea(int) blowfish(ptr)

compiler: gcc -DZLIB -DZLIB_SHARED -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS

 -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -

DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -

DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -

DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -

DENGINESDIR="\"/usr/lib/engines-1.1\""  -Wa,--noexecstackOPENSSLDIR: "/etc/ssl"

ENGINESDIR: "/usr/lib/engines-1.1"

 

五. 测试nginx 访问 http/https 访问正常

 

 

猜你喜欢

转载自www.cnblogs.com/lzcys8868/p/9129896.html