Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if installed OpenSSL version is >= 0.9.8k

Tags:

php

openssl

I have a PHP 5.x script which requires OpenSSL 0.9.8k or higher.

In regard to OpenSSL, I found the following two relevant constants:

OPENSSL_VERSION_TEXT (with value 'OpenSSL 1.0.0c 2 Dec 2010')
OPENSSL_VERSION_NUMBER (with value '268435519')

Unfortunately, I have no clue how to do the mentioned check on these values.

like image 302
HomeCoder Avatar asked Mar 13 '12 23:03

HomeCoder


People also ask

How do I know what version of OpenSSL I have?

Type "openssl version" and press "Enter." The OpenSSL version is displayed in the Windows command line utility.

How do I know if OpenSSL is installed?

Run OpenSSL Open the command prompt using 'Windows' + 'r' then type 'cmd' to open command prompt. Type openssl version command on CLI to ensure OpenSSL is installed and configured on your Windows machine. You should see the version information if OpenSSL is configured correctly.

Where is OpenSSL installed?

Find the path to the trusted certificates OPENSSLDIR: "/var/ssl" (AIX) OPENSSLDIR: "/etc/pki/tls" (RHEL) OPENSSLDIR: "/etc/ssl" (SLES) OPENSSLDIR: "/usr/lib/ssl" (Ubuntu)


1 Answers

The source for version 0.9.8k has a constant OPENSSL_VERSION_NUMBER of 0x009080bf

<?php

if(OPENSSL_VERSION_NUMBER < 0x009080bf) {
    echo "OpenSSL Version Out-of-Date";
} else {
    echo "OpenSSL Version OK";
}

?>
like image 180
Martin Avatar answered Nov 09 '22 15:11

Martin