Problem Overview
CentOS 5 ships with OpenSSL 0.9.8e, which lacks support for modern TLS protocols (TLS 1.1 and TLS 1.2) required by many current websites and services. This results in connection errors such as:
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
This guide outlines solutions to enable modern TLS connectivity while preserving system stability.
Solution Options
1. Install Newer OpenSSL Alongside System Version: This approach installs a newer version of OpenSSL in a separate location (/usr/local/ssl), allowing modern TLS support for specific applications without breaking system dependencies.
2. Update System OpenSSL (Not Recommended): The CentOS 5 repositories only offer backported security fixes for OpenSSL 0.9.8e without protocol upgrades. Replacing the system OpenSSL would break dependencies, so this option is not recommended.
3. Use Third-Party Repositories: Some third-party repositories, such as TuxAD, offer newer OpenSSL packages for CentOS 5. This introduces external dependencies and potential system inconsistencies.
Detailed Resolution Steps
Step 1: Install Build Prerequisites
- yum install gcc make zlib-devel
Step 2: Download and Extract OpenSSL
- mkdir -p /usr/local/src
- cd /usr/local/src
- wget https://www.openssl.org/source/openssl-1.0.2u.tar.gz
- tar -zxf openssl-1.0.2u.tar.gz
- cd openssl-1.0.2u
Step 3: Configure and Compile OpenSSL
- ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
- Make
- make install
Step 4: Configure Library Path
- echo "/usr/local/ssl/lib" > /etc/ld.so.conf.d/openssl-1.0.2.conf
- /sbin/ldconfig -v
Step 5: Create Binary Symlinks
- ln -s /usr/local/ssl/bin/openssl /usr/local/bin/openssl
Step 6: Update Environment
- echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bashrc
- source ~/.bashrc
Step 7: Verify Installation
- /usr/local/bin/openssl version
- # Should display: OpenSSL 1.0.2u 20 Dec 2019
Step 8: Rebuild Applications to Use New OpenSSL
For applications like curl:
- cd /usr/local/src
- wget https://curl.haxx.se/download/curl-7.69.1.tar.gz
- tar -zxf curl-7.69.1.tar.gz
- cd curl-7.69.1
- ./configure --with-ssl=/usr/local/ssl --prefix=/usr/local
- Make
- make install
Additional Considerations
Library Paths for Applications: For applications that aren’t recompiled, temporarily use the new OpenSSL:
export LD_LIBRARY_PATH=/usr/local/ssl/lib:$LD_LIBRARY_PATH
YUM Repository Compatibility: For YUM repositories requiring modern TLS, use the recompiled curl to download repository files or configure plugins like fastestmirror to exclude problematic repositories. Consider using a proxy server with modern TLS support.
EL7 Package Compatibility Issues: CentOS 5 cannot install packages built for EL7 due to:
- Different glibc versions and ABI incompatibilities
- Missing features in RPM package manager
- Different kernel versions
For packages only available for newer distributions:
- Seek EL5-compatible versions
- Compile from source with CentOS 5 compatibility adjustments
- Consider upgrading to a supported CentOS version
Long-Term Recommendations
CentOS 5 reached end-of-life in March 2017 and no longer receives security updates. For production environments, consider:
- Migrating to a supported distribution (CentOS 7 or 8)
- Implementing network-level proxies for TLS termination if legacy systems must be maintained
Isolating legacy systems from direct internet access using air-gapping or VPNs.
Troubleshooting Common Issues
Missing TLS Version Support
Step 1: Verify OpenSSL build:
openssl ciphers -v | grep TLSv1.2
Step 2: Ensure applications were compiled with the new OpenSSL libraries.
Library Load Failures
Step 1: Check for missing dependencies:
ldd /usr/local/bin/curl
Step 2: Verify library paths: ldconfig -v | grep ssl
YUM Repository Errors: Manually download repository files using the new curl and create local repositories for critical packages.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article