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
string
Requested host
string
dNSName to match against
boolean
Does 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 |
---|
string
Host name to verify against
array
Certificate data from openssl_x509_parse()
\Requests_Exception |
On not obtaining a match for the host (`fsockopen.ssl.no_match`) |
---|
boolean
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.
string
Reference dNSName
boolean
Is the name valid?