The Command
openssl version
openssl version -aThe first prints the version and its upstream release date. With -a it adds the build date, the platform, the build options, and OPENSSLDIR, the folder where OpenSSL looks for its configuration and certificates. The commands are the same on Debian, Ubuntu, AlmaLinux, and Rocky Linux.
The Tool and the Library
The openssl command is a tool for keys, certificates, and tests. Nginx, Apache, PHP, Python, curl, and SSH use the OpenSSL shared libraries, libssl and libcrypto, not the tool. Usually both come from the same source package, but they are separate packages:
- Debian and Ubuntu:
opensslfor the tool and alibsslpackage for the library; its exact name depends on the release. - AlmaLinux and Rocky Linux:
opensslfor the tool andopenssl-libsfor the library.
Check the Package Version
On Debian and Ubuntu:
apt list --installed 'openssl' 'libssl*'
dpkg -l | grep -E 'openssl|libssl'On AlmaLinux and Rocky Linux:
rpm -q openssl openssl-libsThe package version is the upstream number followed by the distribution's own revision. That revision is what tells you which fixes are installed.
Why the Upstream Number Looks Old
Distributions keep one OpenSSL version for the life of a release and apply security fixes to it. This is called backporting. The upstream number in openssl version stays the same, while the package revision goes up. A scanner that only compares the upstream number will report vulnerabilities that are already fixed. To see which fixes a package contains, search its changelog:
apt changelog openssl | grep CVE- | head
rpm -q --changelog openssl | grep CVE- | headCompare the CVE numbers with the security notice of your distribution rather than with the upstream release list.
Which OpenSSL a Service Uses
nginx -V 2>&1 | grep -i openssl
php -i | grep -i 'openssl library'
python3 -c 'import ssl; print(ssl.OPENSSL_VERSION)'
curl --versionnginx -V shows the OpenSSL version Nginx was built with, and adds the version it is running with when the two differ. A program built with its own OpenSSL copy does not use the system library and needs its own updates.
Update OpenSSL the Right Way
Update it through the package manager only:
sudo apt update
sudo apt upgradeOn AlmaLinux and Rocky Linux, run sudo dnf upgrade. Do not compile a newer OpenSSL and install it over the system one. Every other package was built against the system library; replacing it can break SSH, apt, or dnf, and a hand-built copy receives no security updates. If an application truly needs a newer OpenSSL, move it to a newer distribution release. Routine update steps are in sudo apt update.
Restart Services After an Update
Running processes keep the old library in memory until they restart. On Debian and Ubuntu, sudo needrestart lists the services that still use replaced libraries; install the needrestart package first if the command is missing. On AlmaLinux and Rocky Linux, sudo dnf needs-restarting -s does the same. Restart those services, or reboot; see how to reboot a Linux server.
Test a TLS Connection
To see what a web server negotiates, connect with the tool:
openssl s_client -connect example.com:443 -servername example.com < /dev/nullThe summary shows the protocol, the cipher, and the certificate chain. If a site behind Cloudflare fails its handshake with the origin, see Cloudflare error 525.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations