SSL utilities for Requests
Collection of utilities for working with and verifying SSL certificates.
| package | Requests |
|---|---|
| subpackage | Utilities |
match_domain(string $host, string $reference) : boolean
stringRequested host
stringdNSName 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 |
|---|
stringHost name to verify against
arrayCertificate data from openssl_x509_parse()
\Requests_Exception |
On not obtaining a match for the host (`fsockopen.ssl.no_match`) |
|---|
booleanverify_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.
stringReference dNSName
booleanIs the name valid?