Skip to content

Instantly share code, notes, and snippets.

@Bill-tran
Created September 7, 2021 09:22
Show Gist options
  • Save Bill-tran/5e2ab062a9028bf693c934146249e68c to your computer and use it in GitHub Desktop.
Save Bill-tran/5e2ab062a9028bf693c934146249e68c to your computer and use it in GitHub Desktop.
How to install openssl 1.1.1 on CentOS 7

How To Install OpenSSL 1.1.1 on CentOS 7

This tutorial goes through how to install openssl 1.1.1 on CentOS 7, since the yum repo only installs up to openssl 1.0.

Requirements

Upgrade the system

yum -y update

Install required packages

yum install -y make gcc perl-core pcre-devel wget zlib-devel

Download the latest version of OpenSSL source code

wget https://ftp.openssl.org/source/openssl-1.1.1k.tar.gz

Configure, build and install OpenSSL

Uncompress the source file

tar -xzvf openssl-1.1.1k.tar.gz

Change to the OpenSSL directory

cd openssl-1.1.1k

Configure the package for compilation

./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic

Compile package

make

Test compiled package

make test

Install compiled package

make install

Export library path

Create environment variable file

vim /etc/profile.d/openssl.sh

Add the following content

export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64

Load the environment variable

source /etc/profile.d/openssl.sh

Verify the OpenSSL version

openssl version
@PauloCarvalhoRJ
Copy link

Hello, how do I install it as a devel package? thanks;

@je5sss
Copy link

je5sss commented Jul 13, 2024

Really helpful, thanks a lot.

And for anyone who encountered: "openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory", check if libssl.so.1.1 is actually under /usr/lib (my case). If so, modify /etc/profile.d/openssl.sh as follows and source again:

export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:/usr/lib:/usr/lib64

@nzzlinh
Copy link

nzzlinh commented Oct 23, 2024

At 2024 Oct, https://ftp.openssl.org/source/openssl-1.1.1k.tar.gz is no more available

Please use this command instead:

wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment