1
2
3
4
5
6
7
8
9
10
11
|
#wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz #tar zxvf openssl-1.1.0e.tar.gz
# cd openssl-1.1.0e # ./config shared zlib # make # make install #替换旧版OpenSSL mv /usr/bin/openssl /usr/bin/openssl .old
mv /usr/include/openssl /usr/include/openssl .old
ln -s /usr/local/bin/openssl /usr/bin/openssl
ln -s /usr/local/include/openssl/ /usr/include/openssl
|
安装过程遇到一些问题:
1、解决Centos6编译错误:expecting string instruction
1
2
3
|
wget http: //people .centos.org /tru/devtools-2/devtools-2 .repo -O /etc/yum .repos.d /devtools-2 .repo
yum install devtoolset-2-gcc devtoolset-2-binutils
yum install devtoolset-2-gcc-gfortran
|
2、加载共享库时出错:libcrypto.so.1.1
1
2
|
When I run "openssl" I am getting an error as below :
openssl: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file : No such file or directory"
|
解决办法:
1
2
|
echo "/usr/local/lib64" > /etc/ld .so.conf.d /openssl .conf
ldconfig |
确认升级版本
1
2
3
4
5
6
7
|
# openssl version -a OpenSSL 1.1.0f 16 Feb 2017 built on: reproducible build, date unspecified
platform: linux-x86_64 compiler: gcc -DZLIB -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= "\"/usr/local/ssl\"" -DENGINESDIR= "\"/usr/local/lib/engines-1.1\"" -Wa,--noexecstack
OPENSSLDIR: "/usr/local/ssl"
ENGINESDIR: "/usr/local/lib/engines-1.1"
|
编译安装openssl时使用参数zlib-dynamic和zlib区别
./config shared zlib #静态链接
./config shared zlib-dynamic #动态链接
参考资料:
https://www.isthnew.com/upgrade-your-openssl/
https://serverfault.com/questions/818445/error-while-loading-shared-libraries-libcrypto-so-1-1
本文转自 boy461205160 51CTO博客,原文链接:http://blog.51cto.com/461205160/1951527