DEV Community

Nikola Stojiljkovic
Nikola Stojiljkovic

Posted on • Edited on

Update OpenSSL to 3.0 on CentOS7

Prerequisites

Use sudo when needed.

Install perl-IPC-Cmd and perl-Test-Simple:



sudo yum install perl-IPC-Cmd perl-Test-Simple


Enter fullscreen mode Exit fullscreen mode

Download and install OpenSSL 3.0

Go to OpenSSL's download page and copy the link to the latest version. At this time it's 3.0.0. Then run (adapt the command to reflect your version):



cd /usr/src
wget https://www.openssl.org/source/openssl-3.0.0.tar.gz
tar -zxf openssl-3.0.0.tar.gz
rm openssl-3.0.0.tar.gz


Enter fullscreen mode Exit fullscreen mode

Compile, make, test and install OpenSSL:


 bash
cd /usr/src/openssl-3.0.0
./config
make
make test
make install


Enter fullscreen mode Exit fullscreen mode

Create symlinks to libssl and libcrypto:



ln -s /usr/local/lib64/libssl.so.3 /usr/lib64/libssl.so.3
ln -s /usr/local/lib64/libcrypto.so.3 /usr/lib64/libcrypto.so.3


Enter fullscreen mode Exit fullscreen mode

Test the installed version with:



openssl version


Enter fullscreen mode Exit fullscreen mode

You should get something like this:



OpenSSL 3.0.0 7 sep 2021 (Library: OpenSSL 3.0.0 7 sep 2021)


Enter fullscreen mode Exit fullscreen mode

If you liked the article,...
Image description

Top comments (7)

Collapse
 
rianmz profile image
River Martinez

Is this include Apache module ssl? I am no sure that this change the Apache configuration. In the console the response is:
OpenSSL 3.0.1 14 Dec 2021 (Library: OpenSSL 3.0.1 14 Dec 2021)
But apache return:
Apache/2.4.51 () OpenSSL/1.0.2k-fips PHP/7.3.29

Do you know what is missing?

Collapse
 
nikolastojilj12 profile image
Nikola Stojiljkovic

No, this guide does not cover Apache's SSL module. That's a different topic.

Collapse
 
ahmedmostafaalsayed profile image
Ahmed Mostafa Abdel-Baky

I followed your guide, but I needed to execute this command as well:

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

Collapse
 
abernardomoonlight profile image
Alexandre

i run this, but still return old version

Collapse
 
crankynicon profile image
Jorge Diaz M. ホルヘ ディアス

I followed the steps showed in here but when I write openssl version at the last it keeps showing me the older version, do you know why is this?

Collapse
 
abernardomoonlight profile image
Alexandre

I have the some problem

Collapse
 
ahmedmostafaalsayed profile image
Ahmed Mostafa Abdel-Baky