The question is raised because the original openssl version doesn't pass the Vulnerability Scanning, therefore I need to upgrade the openssl package on apache centos 7 and I am using httpd. I have some observations after spending some time
The default openssl version is OpenSSL 1.0.2k-fips, which is the default openssl version for mod_ssl, which in turn is a dependency of httpd 2.4.6-97.el7.centos.5 package, so when I yum install httpd, the mod_ssl is automatically pointing to that openssl version
I follow the guideline in https://gist.github.com/fernandoaleman/5459173e24d59b45ae2cfc618e20fe06 , instead of version 1.1.1, I installed version 3.0.0, other commands are the same as the guideline mentioned, I checked the openssl version after the upgrade by running
openssl version
, the output is correct, but when I send request to the server, the response header still displays the original version:Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_wsgi/4.5.18 Python/3.6
This is the output when I
ldd mod_ssl.so
in/usr/lib64/httpd/modules folder
:
linux-vdso.so.1 => (0x00007ffd44ddd000)
libssl.so.10 => /lib64/libssl.so.10 (0x00007fe07f09c000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007fe07ec39000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fe07ea1d000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fe07e819000)
libc.so.6 => /lib64/libc.so.6 (0x00007fe07e44b000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007fe07e1fe000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007fe07df15000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fe07dd11000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007fe07dade000)
libz.so.1 => /lib64/libz.so.1 (0x00007fe07d8c8000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe07f545000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007fe07d6b8000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007fe07d4b4000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fe07d29a000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fe07d073000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fe07ce11000)
I know that it's a dependency issue, the mod_ssl is not pointing to the new installed openssl 3.0.0, so is there a way to make mod_ssl point to the new openssl version? or I can install openssl 3.0.0 to the default directory that mod_ssl is pointing to? (I don't want to install httpd manually because I don't want to break the dependencies ) I am a beginner of server stuff, it is appreciated if you guys can give me a hand, thanks
Assuming you already have apache + mod_ssl + openssl installed from the official centos repository, you could do something like this:
For OpenSSL:
For Apache (you could probably use a newer version, I just took the same version as from the official repository):
Basically it will compile Apache from source, mod_ssl as well and it will replace the default files with the ones you just compiled.
Tested it on my centos7 linux box: