[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/Requests/src/ -> Ssl.php (summary)

SSL utilities for Requests

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

Defines 3 functions

  verify_certificate()
  verify_reference_name()
  match_domain()

Functions
Functions that are not part of a class:

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|Stringable $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|Stringable $reference Reference dNSName
return: boolean Is the name valid?

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

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



Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref