How to update openssl 1.1.0 in Centos 6.9/7.0

Check openssl version

openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013

or this:

yum info openssl
Name      : openssl
Arch        : x86_64
Epoch     : 1
Version  : 1.0.1e
Release  : 60.el7_3.1

Check openssl location before you proceed the upgrade

which openssl

/usr/bin/openssl

we have to softlink back to this path after we upgrade the openssl.

Install openssql 1.1.0 from sources

1. Download and extract:

cd ~
wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz
tar -xzf openssl-1.1.0f.tar.gz

2. Compile and install:

cd openssl-1.1.0f
./config
make
sudo make install

Now if you try to run openssl, you will get this error:

/usr/local/bin/openssl version
/usr/local/bin/openssl: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory

To fix it, we need to do the next step.

3. Create links to libssl:

sudo ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/
sudo ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/

4. Finally create link to new openssl

sudo ln -s /usr/local/bin/openssl /usr/bin/openssl_latest

Here I called it ‘openssl_latest’, you can change it to whatever you want.

5. Now let’s check version of our ‘openssl_latest’, which should be ‘1.1.0f’ at the time of writing:

openssl_latest version
OpenSSL 1.1.0f 25 May 2017

Additional tips

you can also rename the old openssl and rename the latest openssl to the old name.

cd /usr/bin/
mv openssl openssl_old
mv openssl_latest openssl

Thanks for using LinuxScriptshub.com

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *