To build OpenSSL 1.1.1w from source on Debian 11 (x86_64), follow these steps:
1. Install Dependencies
Before compiling OpenSSL, ensure you have the necessary build tools and dependencies installed:
sh
sudo apt update
sudo apt install -y build-essential checkinstall perl zlib1g-dev
2. Download and Extract OpenSSL Source
sh
wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz
tar -xvzf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
3. Configure OpenSSL
Configure OpenSSL with a suitable prefix (e.g., /usr/local/ssl
) and enable optimizations:
sh
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
If you need static libraries instead, remove shared
.
4. Compile and Install
sh
make -j$(nproc) # Compiles using all available CPU cores
sudo make install
5. Update Library Paths
Ensure your system uses the newly compiled OpenSSL instead of the default Debian version.
5.1 Add OpenSSL to Library Path
sh
echo "/usr/local/ssl/lib" | sudo tee -a /etc/ld.so.conf.d/openssl-1.1.1w.conf
sudo ldconfig
5.2 Update System Paths
Modify your environment variables to prioritize the new OpenSSL:
sh
echo 'export PATH="/usr/local/ssl/bin:$PATH"' | sudo tee -a /etc/profile.d/openssl.sh
source /etc/profile.d/openssl.sh
6. Verify Installation
Check if the new OpenSSL version is in use:
sh
openssl version -a
You should see OpenSSL 1.1.1w
and the correct installation path.