[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/Requests/ -> SSL.php (summary)

SSL utilities for Requests

File Size: 144 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Requests_SSL:: (3 methods):
  verify_certificate()
  verify_reference_name()
  match_domain()


Class: Requests_SSL  - X-Ref

SSL utilities for Requests

Collection of utilities for working with and verifying SSL certificates.

verify_certificate($host, $cert)   X-Ref
Verify the certificate against common name and subject alternative names

Unfortunately, PHP doesn't check the certificate against the alternative
names, leading things like 'https://www.github.com/' to be invalid.

param: string $host Host name to verify against
param: array $cert Certificate data from openssl_x509_parse()
return: bool

verify_reference_name($reference)   X-Ref
Verify that a reference name is valid

Verifies a dNSName for HTTPS usage, (almost) as per Firefox's rules:
- Wildcards can only occur in a name with more than 3 components
- Wildcards can only occur as the last character in the first
component
- Wildcards may be preceded by additional characters

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.

param: string $reference Reference dNSName
return: boolean Is the name valid?

match_domain($host, $reference)   X-Ref
Match a hostname against a dNSName reference

param: string $host Requested host
param: string $reference dNSName to match against
return: boolean Does the domain match?



Generated : Thu Dec 15 08:20:01 2022 Cross-referenced by PHPXref