TlsHelper
in package
Tags
Table of Contents
- checkCertificateHost() : bool
- Match hostname against a certificate.
- getCertificateFingerprint() : mixed
- Get the certificate pin.
- getCertificateNames() : array<string|int, mixed>|null
- Extract DNS names out of an X.509 certificate.
- isOpensslParseSafe() : bool
- Test if it is safe to use the PHP function openssl_x509_parse().
- certNameMatcher() : callable|void
- Convert certificate name into matching function.
Methods
checkCertificateHost()
Match hostname against a certificate.
public
static checkCertificateHost(mixed $certificate, string $hostname[, string &$cn = null ]) : bool
Parameters
- $certificate : mixed
-
X.509 certificate
- $hostname : string
-
Hostname in the URL
- $cn : string = null
-
Set to the common name of the certificate iff match found
Return values
bool —getCertificateFingerprint()
Get the certificate pin.
public
static getCertificateFingerprint(mixed $certificate) : mixed
By Kevin McArthur of StormTide Digital Studios Inc.
Parameters
- $certificate : mixed
Tags
Return values
mixed —getCertificateNames()
Extract DNS names out of an X.509 certificate.
public
static getCertificateNames(mixed $certificate) : array<string|int, mixed>|null
Parameters
- $certificate : mixed
-
X.509 certificate
Return values
array<string|int, mixed>|null —isOpensslParseSafe()
Test if it is safe to use the PHP function openssl_x509_parse().
public
static isOpensslParseSafe() : bool
This checks if OpenSSL extensions is vulnerable to remote code execution via the exploit documented as CVE-2013-6420.
Return values
bool —certNameMatcher()
Convert certificate name into matching function.
private
static certNameMatcher(string $certName) : callable|void
Parameters
- $certName : string
-
CN/SAN