2024-12-13
Quote
“Even if it’s selfish… I still hope those people can always wear a smile…” — Natsume’s Book of Friends · Sai
Updating OpenSSL on CentOS 7
-
Download and extract the OpenSSL tarball, then change into its directory
wget https://www.openssl.org/source/openssl-3.4.0.tar.gz
tar -zxvf openssl-3.4.0.tar.gz
cd openssl-3.4.0 -
Configure the build
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib
At this point, you may encounter the following error:
Can't locate IPC/Cmd.pm in @INC (@INC contains: /data/install_package/openssl-3.4.0/util/perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /data/install_package/openssl-3.4.0/external/perl/Text-Template-1.56/lib) at /data/install_package/openssl-3.4.0/util/perl/OpenSSL/config.pm line 19.
BEGIN failed--compilation aborted at /data/install_package/openssl-3.4.0/util/perl/OpenSSL/config.pm line 19.
Compilation failed in require at /data/install_package/openssl-3.4.0/Configure line 23.
BEGIN failed--compilation aborted at /data/install_package/openssl-3.4.0/Configure line 23. -
Resolve the missing Perl module by installing
perl-CPAN
and theIPC::Cmd
modulesudo yum install perl-CPAN -y
sudo cpan install IPC::Cmd -
Compile and install OpenSSL
make -j$(nproc)
sudo make install -
Update the system’s library path and reload the linker configuration
echo "/usr/local/openssl/lib64" | sudo tee -a /etc/ld.so.conf.d/openssl-3.conf
sudo ldconfig -
Verify the installed OpenSSL version
/usr/local/openssl/bin/openssl version