How to Install and Update OpenSSL on CentOS 7

r00t January 13, 2018

Install and Update OpenSSL on CentOS 7

In this tutorial we’ll learn how to install and Update OpenSSL on CentOS 7. We will also install and configure its prerequisites. OpenSSL is a library that provides cryptographic functionality, especially SSL/TLS for popular applications like secure servers, MySQL databases and email programs. The list attributes standard-commands, digest-commands, and cipher-commands output a list (one entry per line) of the names of all standard commands, message digest commands, or cipher commands, respectively, that are available in the current openssl utility.

I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install and Update OpenSSL on CentOS 7

Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:

yum -y install epel-release
yum -y update

Step 2. Install OpenSSL.

First, Get the current version with “openssl version” and “yum info openssl” command:

### openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013
### yum info openssl

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.ratiokontakt.de
 * epel: mirrors.n-ix.net
 * extras: mirror.de.leaseweb.net
 * updates: mirror.softaculous.com
Installed Packages
Name        : openssl
Arch        : x86_64
Epoch       : 1
Version     : 1.0.1e
Release     : 51.el7_2.1
Size        : 1.5 M
Repo        : installed
From repo   : updates
Summary     : Utilities from the general purpose cryptography library with TLS
            : implementation
URL         : http://www.openssl.org/
License     : OpenSSL
Description : The OpenSSL toolkit provides support for secure communications
            : between machines. OpenSSL includes a certificate management tool
            : and shared libraries which provide various cryptographic
            : algorithms and protocols.

Available Packages
Name        : openssl
Arch        : x86_64
Epoch       : 1
Version     : 1.0.1e
Release     : 51.el7_2.2
Size        : 711 k
Repo        : updates/7/x86_64
Summary     : Utilities from the general purpose cryptography library with TLS
            : implementation
URL         : http://www.openssl.org/
License     : OpenSSL
Description : The OpenSSL toolkit provides support for secure communications
            : between machines. OpenSSL includes a certificate management tool
            : and shared libraries which provide various cryptographic
            : algorithms and protocols.

 

Next, download the latest version of OpenSSL using following command:

cd /usr/local/src
wget https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
tar -zxf openssl-1.0.2-latest.tar.gz

Once the file is extracted, compile OpenSSL and install/upgrade OpenSSL as follows:

cd openssl-1.0.2a
./config
make
make test
make install

We now copy older version on other path:

mv /usr/bin/openssl /root/
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl

Now verify the OpenSSL version:

### openssl version
OpenSSL 1.0.2k 26 Dec 2017

Congratulation’s! You have successfully install and update OpenSSL on your CentOS 7 server. Thanks for using this tutorial for installing OpenSSL on CentOS 7 system.

Leave a Comment

Comments are closed.