This tutorial goes through how to install openssl 1.1.1 on CentOS 9
Upgrade the system
sudo dnf -y update
Install required packages
sudo dnf install -y make gcc perl-core pcre-devel wget zlib-devel
Download the latest version of OpenSSL source code
wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz
Uncompress the source file
tar -xzvf openssl-1.1.1w.tar.gz
Change to the OpenSSL directory
cd openssl-1.1.1w
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
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
openssl version
Thanks, that helps a lot