How do I upgrade OpenSSL in CentOS 6.5?
I have used these commands, but nothings happens:
cd /usr/src
wget http://www.openssl.org/source/openssl-1.
./config --prefix=/usr --openssldir=/usr/local/openssl shared
Try this config line instead to overwrite the default. It installs to prefix /usr/local/ssl by default in your setup when you leave off the prefix. You probably have "/usr/local/ssl/bin/openssl" instead of overwriting /usr/bin/openssl. You can also use /usr/local for prefix instead, but you would need to adjust your path accordingly if that is not already on your path. Here is the INSTALL documentation:
$ ./config
$ make
$ make test
$ make install
[If any of these steps fails, see section Installation in Detail below.]
This will build and install OpenSSL in the default location, which is (for
historical reasons) /usr/local/ssl. If you want to install it anywhere else,
run config like this:
$ ./config --prefix=/usr/local --openssldir=/usr/local/openssl
https://github.com/openssl/openssl/blob/master/INSTALL http://heartbleed.com/
I agree that in 95% of cases, all you need is sudo yum update openssl
However, if you need a specific version of openssl or specific functionality, which is not in CentOS repository, you probably need to compile from source. The other answers here were incomplete. Below is what worked (CentOS 6.9), although this may introduce incompatibilities with installed software, and will not auto-update the openssl.
Choose openssl version from https://www.openssl.org/source/
Log-in as root:
cd /usr/local/src/
# OPTIONALLY CHANGE openssl-1.1.0f.tar.gz to the version which you want
wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz
sha256sum openssl-1.1.0f.tar.gz #confirm this matches the published hash
tar -zxf openssl-1.1.0f.tar.gz
cd /usr/local/src/openssl-1.1.0f
./config --prefix=/usr/local --openssldir=/usr/local/openssl
make
make test
make install
export LD_LIBRARY_PATH=/usr/local/lib64
#make export permanent
echo "export LD_LIBRARY_PATH=/usr/local/lib64" > /etc/profile.d/ld_library_path.sh
chmod ugo+x /etc/profile.d/ld_library_path.sh
openssl version #confirm it works
#recommended reboot here
openssl version #confirm it works after reboot
rpm -qa openssl
yum clean all && yum update "openssl*"
lsof -n | grep ssl | grep DEL
cd /usr/src
wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
tar -zxf openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
./config --prefix=/usr --openssldir=/usr/local/openssl shared
./config
make
make test
make install
cd /usr/src
rm -rf openssl-1.0.1g.tar.gz
rm -rf openssl-1.0.1g
and
openssl version
You can also check the local changelog to verify whether or not OpenSSL is patched against the vulnerability with the following command:
rpm -q --changelog openssl | grep CVE-2014-0224
If a result is not returned, then you must patch OpenSSL.
http://www.liquidweb.com/kb/update-and-patch-openssl-for-the-ccs-injection-vulnerability/
My approach was:
openssl version
OpenSSL 1.0.1e 11 Feb 2013
wget https://www.openssl.org/source/openssl-1.0.2a.tar.gz
wget http://www.linuxfromscratch.org/patches/blfs/svn/openssl-1.0.2a-fix_parallel_build-1.patch
tar xzf openssl-1.0.2a.tar.gz
cd openssl-1.0.2a
patch -Np1 -i ../openssl-1.0.2a-fix_parallel_build-1.patch
./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib shared zlib-dynamic
make
make install
openssl version
OpenSSL 1.0.2a 19 Mar 2015
sudo yum update openssl
is all you need.
This will bring you up to openssl-1.0.1e-16.el6_5.7
.
You need to restart Apache after the update. Or better yet, reboot the box if possible, so that all applications that use OpenSSL will load the new version.