- 如果有使用OpenSSL 1.0.1到OpenSSL1.0.1f的版本建议升级到OpenSSL1.0.1g或最新的OpenSSL1.0.1h。
- 使用DEPENSSL_NO_HEARTBEATS参数重新编译低版本的OpenSSL以禁用Heartbleed模块。
- 删除OpenSSL组件。
[root@pru1~]# uname -aLinuxpru1 2.6.18-308.el5 #1 SMP Fri Jan 27 17:17:51 EST 2012 x86_64 x86_64 x86_64GNU/Linux [root@pru1~]# openssl versionOpenSSL0.9.8e-fips-rhel5 01 Jul 20082、 下载最新的源码包 3、 解压缩编译安装
[root@pru1openssl]# lsopenssl-1.0.1h.tar.gz[root@pru1openssl]# tar -zxf openssl-1.0.1h.tar.gz[root@pru1openssl]# lsopenssl-1.0.1h openssl-1.0.1h.tar.gz[root@pru1openssl]# cd openssl-1.0.1h[root@pru1openssl-1.0.1h]# lsACKNOWLEDGMENTS config e_os2.h INSTALL.DJGPP INSTALL.W64 Makefile.org openssl.doxy README.ASN1 toolsapps Configure e_os.h INSTALL.MacOS INSTALL.WCE Makefile.shared openssl.spec README.ENGINE utilbugs crypto FAQ INSTALL.NW LICENSE makevms.com os2 shlib VMScerts demos include INSTALL.OS2 MacOS ms perl sslCHANGES doc INSTALL INSTALL.VMS Makefile Netware PROBLEMS testCHANGES.SSLeay engines install.com INSTALL.W32 Makefile.bak NEWS README times[root@pru1openssl-1.0.1h]# ./config shared zlibOperatingsystem: x86_64-whatever-linux2Configuringfor linux-x86_64Configuringfor linux-x86_64 no-ec_nistp_64_gcc_128 [default] OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir) no-gmp [default] OPENSSL_NO_GMP (skip dir) no-jpake [experimental] OPENSSL_NO_JPAKE (skipdir) no-krb5 [krb5-flavor not specified]OPENSSL_NO_KRB5 no-md2 [default] OPENSSL_NO_MD2 (skip dir) no-rc5 [default] OPENSSL_NO_RC5 (skip dir) no-rfc3779 [default] OPENSSL_NO_RFC3779 (skip dir) no-sctp [default] OPENSSL_NO_SCTP (skip dir) no-store [experimental] OPENSSL_NO_STORE (skipdir) no-zlib-dynamic [default]IsMK1MF=0CC =gccCFLAG =-fPIC -DOPENSSL_PIC -DZLIB-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT-DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM-DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM-DGHASH_ASMEX_LIBS =-ldl -lzCPUID_OBJ =x86_64cpuid.oBN_ASM =x86_64-gcc.o x86_64-mont.ox86_64-mont5.o x86_64-gf2m.o modexp512-x86_64.oDES_ENC =des_enc.o fcrypt_b.oAES_ENC =aes-x86_64.o vpaes-x86_64.obsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.oBF_ENC =bf_enc.oCAST_ENC =c_enc.oRC4_ENC =rc4-x86_64.o rc4-md5-x86_64.oRC5_ENC =rc5_enc.oMD5_OBJ_ASM =md5-x86_64.oSHA1_OBJ_ASM =sha1-x86_64.o sha256-x86_64.osha512-x86_64.oRMD160_OBJ_ASM=CMLL_ENC =cmll-x86_64.o cmll_misc.oMODES_OBJ =ghash-x86_64.oENGINES_OBJ =PROCESSOR =RANLIB =/usr/bin/ranlibARFLAGS =PERL =/usr/bin/perlSIXTY_FOUR_BIT_LONGmodeDES_UNROLLusedDES_INTusedRC4_CHUNKis unsigned longe_os2.h=> include/openssl/e_os2.hmakinglinks in crypto...make[1]:Entering directory `/root/openssl/openssl-1.0.1h/crypto'crypto.h=> ../include/openssl/crypto.hopensslv.h=> ../include/openssl/opensslv.hopensslconf.h=> ../include/openssl/opensslconf.hebcdic.h=> ../include/openssl/ebcdic.hsymhacks.h=> ../include/openssl/symhacks.hossl_typ.h=> ../include/openssl/ossl_typ.hmakinglinks in crypto/objects...………….Configuredfor linux-x86_64.[root@pru1openssl-1.0.1h]# makemakingall in crypto...make[1]:Entering directory `/root/openssl/openssl-1.0.1h/crypto'( echo"#ifndef MK1MF_BUILD"; \ echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \ echo ' #define CFLAGS "gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS-D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN-DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT-DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM-DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM-DGHASH_ASM"'; \ echo ' #define PLATFORM "linux-x86_64"'; \ echo " #define DATE \"`LC_ALL=C LC_TIME=Cdate`\""; \ echo '#endif' ) >buildinf.hgcc -I.-I.. -I../include -fPIC -DOPENSSL_PIC-DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H-Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM-DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM-DWHIRLPOOL_ASM -DGHASH_ASM -c -ocryptlib.o cryptlib.ccryptlib.c:In function ‘OPENSSL_ia32cap_loc’:cryptlib.c:677:warning: dereferencing type-punned pointer will break strict-aliasing rulesgcc -I.-I.. -I../include -fPIC -DOPENSSL_PIC-DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H-Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM-DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM-DWHIRLPOOL_ASM -DGHASH_ASM -c -o mem.omem.cgcc -I.-I.. -I../include -fPIC -DOPENSSL_PIC-DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H-Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM-DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM-DWHIRLPOOL_ASM -DGHASH_ASM -c -omem_dbg.o mem_dbg.c……………. [root@pru1openssl-1.0.1h]# make install…….4、 将新编译的openssl替换系统老版本的
[root@pru1openssl-1.0.1h]# rm -rf /usr/bin/openssl[root@pru1openssl-1.0.1h]# rm -rf /usr/include/openssl/[root@pru1openssl-1.0.1h]# ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl[root@pru1openssl-1.0.1h]# ln -s /usr/local/ssl/include/openssl/ /usr/include/openssl5、 配置文件搜索路径
[root@pru1openssl-1.0.1h]# echo "/usr/local/ssl/lib/" >> /etc/ld.so.conf[root@pru1openssl-1.0.1h]# ldconfig -v |grep openssl libgnutls-openssl.so.13 ->libgnutls-openssl.so.13.0.6 libgnutls-openssl.so.13 ->libgnutls-openssl.so.13.0.66、 查看安装完成后的最新版本
[root@pru1openssl-1.0.1h]# openssl versionOpenSSL1.0.1h 5 Jun 2014[root@pru1openssl-1.0.1h]# openssl version -aOpenSSL1.0.1h 5 Jun 2014builton: Sun Jun 8 09:05:39 CST 2014platform:linux-x86_64options: bn(64,64) rc4(16x,int) des(idx,cisc,16,int)idea(int) blowfish(idx)compiler:gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN-DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5-DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM-DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASMOPENSSLDIR:"/usr/local/ssl"[root@pru1openssl-1.0.1h]#7、 至此已全部完成OpenSSL的升级工作