Overview

Packages

  • Requests
    • Authentication
    • Cookies
    • Proxy
    • Session
    • Transport
    • Utilities

Classes

  • Requests_Hooks
  • Requests_IDNAEncoder
  • Requests_IPv6
  • Requests_IRI
  • Requests_SSL
  • Requests_Utility_CaseInsensitiveDictionary
  • Requests_Utility_FilteredIterator

Interfaces

  • Requests_Hooker
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Warning! You are currently reading the documentation for Requests 1.x.

It is recommended to upgrade to Requests 2.x at your earliest convenience. Upgrading to Requests 2.x is fairly straight-forward.
A full list of the changes can be found in the Changelog.

Visit the documentation for Requests_SSL in Requests 2.x.

Class Requests_SSL

SSL utilities for Requests

Collection of utilities for working with and verifying SSL certificates.

Package: Requests\Utilities
Located at Requests/SSL.php
Methods summary
public static boolean
# verify_certificate( string $host, array $cert )

Verify the certificate against common name and subject alternative names

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.

Parameters

$host
Host name to verify against
$cert
Certificate data from openssl_x509_parse()

Returns

boolean

Throws

Requests_Exception
On not obtaining a match for the host (fsockopen.ssl.no_match)

See

https://tools.ietf.org/html/rfc2818#section-3.1 RFC2818, Section 3.1
public static boolean
# verify_reference_name( string $reference )

Verify that a reference name is valid

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.

Parameters

$reference
Reference dNSName

Returns

boolean
Is the name valid?
public static boolean
# match_domain( string $host, string $reference )

Match a hostname against a dNSName reference

Match a hostname against a dNSName reference

Parameters

$host
Requested host
$reference
dNSName to match against

Returns

boolean
Does the domain match?
Requests 1.8.1 API Documentation API documentation generated by ApiGen