SSL utilities for Requests
Collection of utilities for working with and verifying SSL certificates.
match_domain(string $host, string $reference) : boolean
dNSName to match against
booleanDoes the domain match?
verify_certificate(string $host, array $cert) : boolean
Unfortunately, PHP doesn't check the certificate against the alternative names, leading things like 'https://www.github.com/' to be invalid. Instead
|see||RFC2818, Section 3.1|
Host name to verify against
Certificate data from openssl_x509_parse()
||On not obtaining a match for the host (`fsockopen.ssl.no_match`)|
verify_reference_name(string $reference) : boolean
Verifies a dNSName for HTTPS usage, (almost) as per Firefox's rules:
We modify these rules to be a bit stricter and only allow the wildcard character to be the full first component; that is, with the exclusion of the third rule.
booleanIs the name valid?