- root@c215a2b695ef:/home# openssl version
- OpenSSL 1.1.0f 25 May 2017
- wget http://www.openssl.org/source/openssl-1.0.2d.tar.gz
- tar zxvf openssl-1.0.2d.tar.gz
- cd openssl-1.0.2d
- ./config --prefix=/usr/local/ssl
- make && make install
- mv -f /usr/bin/openssl /usr/bin/openssl.old
- mv -f /usr/include/openssl /usr/include/openssl.old
- 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
- ldconfig -v
root@c215a2b695ef:/home/openssl-1.0.2d# openssl version -a
OpenSSL 1.0.2d 9 Jul 2015
一下步骤安装的是openssl 1.0.2g版本,如果要安装其他版本只需要替换1.0.2g到指定版本,例如1.1.0l
1. sudo apt-get install make (Install compiling library Make)
2. wget https://www.openssl.org/source/openssl-1.0.2g.tar.gz (Download the latest OpenSSL 1.0.2g 源代码)
3. tar -xzvf openssl-1.0.2g.tar.gz (Extract the tar ball to the local directory)
4. cd openssl-1.0.2l (Enter extracted OpenSSL directory)
5. sudo ./config (Configure binaries for compiling)
6. sudo make install (install configured binaries)
7. sudo ln -sf /usr/local/ssl/bin/openssl `which openssl` (This will create a sym link to the new binaries), 这一步可能失败,替换 ‘which openssl’ 为 /usr/local/bin/openssl 再试一次
8. openssl version -v (Used to check the version of the Current OpenSSL binaries)