Upgrading OpenSSL
- The OpenSSL version must be 1.1.1a or later.
- View the OpenSSL version:
openssl version
- If the OpenSSL version provided by openEuler is 1.1.1f, you do not need to upgrade OpenSSL. Skip this section.
- The OpenSSL version provided by CentOS is 1.0.2k-fips. This document uses an upgrade to 1.1.1a as an example.
- If Nginx is installed through installation from source code, choose Installation from Source Code to upgrade OpenSSL.
- If Nginx is installed through installation from the mirror site, choose Installing the RPM Package to upgrade OpenSSL.
Installation from Source Code
- Obtain the OpenSSL source code.
- Download the OpenSSL source package using the local browser.
Download address: https://codeload.github.com/openssl/openssl/tar.gz/OpenSSL_1_1_1a
- Upload the source package to the /home directory on the server.
If the server is connected to the Internet, you can run the wget command on the server to download the source code.
- Go to the /home directory and download the source package.
1 2
cd /home wget https://codeload.github.com/openssl/openssl/tar.gz/OpenSSL_1_1_1a --no-check-certificate
- Rename the downloaded source package. (The name of the OpenSSL source package downloaded using a local browser is different from that downloaded using the wget command. In this section, the OpenSSL source package is obtained by using a local browser. If you obtain it using the wget command, rename the downloaded source package.)
1mv OpenSSL_1_1_1a openssl-OpenSSL_1_1_1a.tar.gz
- Go to the /home directory and download the source package.
- Download the OpenSSL source package using the local browser.
- Decompress the OpenSSL source package.
1tar -xvf openssl-OpenSSL_1_1_1a.tar.gz

- Go to the openssl-OpenSSL_1_1_1a directory and run the ls command to query the files in the directory.
1 2
cd openssl-OpenSSL_1_1_1a/ ls

- Configure OpenSSL.
1./config

- Perform the compilation and installation.
1make -j60 && make -j60 install
- -j60: Make full use of multi-core CPUs to accelerate compilation.
- You can run the lscpu command to query the number of CPU cores.
- Configure the ld.so.conf file.
1 2
echo "/usr/local/lib/" >> /etc/ld.so.conf ldconfig -v
- Make OpenSSL take effect.
- Add OpenSSL to the environment variables.
1echo export PATH=/usr/local/bin:\$PATH >> /etc/profile
- Make the environment variables take effect.
1source /etc/profile

- Add OpenSSL to the environment variables.
- View the OpenSSL version.
- Method 1:
1 2
hash -r openssl version

- Method 2:
1 2 3
hash -r which openssl /usr/local/bin/openssl version
- Method 1:
- View the OpenSSL installation directory (OPENSSLDIR).
1openssl version -a
To uninstall OpenSSL that is installed using the source code, use either of the following methods:
- Method 1:
1 2 3 4 5
cd /home/openssl-OpenSSL_1_1_1a make uninstall hash -r openssl version openssl version -a
- Method 2:
1 2 3 4 5 6 7
openssl version -a rm -rf /usr/local/ssl rm -rf /usr/local/lib/engines-1.1 rm -rf /usr/local/bin/openssl hash -r openssl version openssl version -a
Installing the RPM Package
- Obtain the OpenSSL RPM package.
- Download the RPM package using a local browser.
https://mirrors.huaweicloud.com/kunpeng/yum/el/7/aarch64/Packages/web/openssl-libs-1.1.1a-3.el7.aarch64.rpm
https://mirrors.huaweicloud.com/kunpeng/yum/el/7/aarch64/Packages/web/openssl-1.1.1a-3.el7.aarch64.rpm
https://mirrors.huaweicloud.com/kunpeng/yum/el/7/aarch64/Packages/web/openssl-devel-1.1.1a-3.el7.aarch64.rpm
- Copy the RPM package to the /home directory on the server.
If the server is connected to the Internet, you can run the wget command on the server to download the RPM package.
1 2 3 4
cd /home wget https://mirrors.huaweicloud.com/kunpeng/yum/el/7/aarch64/Packages/web/openssl-libs-1.1.1a-3.el7.aarch64.rpm --no-check-certificate wget https://mirrors.huaweicloud.com/kunpeng/yum/el/7/aarch64/Packages/web/openssl-1.1.1a-3.el7.aarch64.rpm --no-check-certificate wget https://mirrors.huaweicloud.com/kunpeng/yum/el/7/aarch64/Packages/web/openssl-devel-1.1.1a-3.el7.aarch64.rpm --no-check-certificate
- Download the RPM package using a local browser.
- Install OpenSSL.
1rpm -ivh openssl-libs-1.1.1a-3.el7.aarch64.rpm openssl-1.1.1a-3.el7.aarch64.rpm openssl-devel-1.1.1a-3.el7.aarch64.rpm --force --nodeps
- Configure the ld.so.conf file.
1 2
echo "/usr/local/lib/" >> /etc/ld.so.conf ldconfig -v
- Make OpenSSL take effect.
1 2
echo export PATH=/usr/local/bin:\$PATH >> /etc/profile source /etc/profile

- View the OpenSSL version.Method 1:
1 2
hash -r openssl version

Method 2:
1 2 3
hash -r which openssl /usr/local/bin/openssl version
- View the OpenSSL installation directory (OPENSSLDIR).
1openssl version -a
To uninstall OpenSSL that is installed using the RPM package, run the following commands:
1 2 3 4 5 6 |
rpm -qa | grep openssl rpm -e --nodeps openssl-devel-1.1.1a openssl-1.1.1a openssl-libs-1.1.1a rpm -qa | grep openssl hash -r openssl version openssl version -a |