class TlsHelper (View source)

Methods

static bool
checkCertificateHost(mixed $certificate, string $hostname, string $cn = null)

Match hostname against a certificate.

static array|null
getCertificateNames(mixed $certificate)

Extract DNS names out of an X.509 certificate.

static 
getCertificateFingerprint($certificate)

Get the certificate pin.

static bool
isOpensslParseSafe()

Test if it is safe to use the PHP function openssl_x509_parse().

Details

static bool checkCertificateHost(mixed $certificate, string $hostname, string $cn = null)

Match hostname against a certificate.

Parameters

mixed $certificate X.509 certificate
string $hostname Hostname in the URL
string $cn Set to the common name of the certificate iff match found

Return Value

bool

static array|null getCertificateNames(mixed $certificate)

Extract DNS names out of an X.509 certificate.

Parameters

mixed $certificate X.509 certificate

Return Value

array|null

static getCertificateFingerprint($certificate)

Get the certificate pin.

By Kevin McArthur of StormTide Digital Studios Inc.

Parameters

$certificate

static bool isOpensslParseSafe()

Test if it is safe to use the PHP function openssl_x509_parse().

This checks if OpenSSL extensions is vulnerable to remote code execution via the exploit documented as CVE-2013-6420.

Return Value

bool