HTTPOptionsTrait
Table of Contents
Properties
- $ca_info : string|null
- CA Root Certificates for use with CURL/SSL
- $curl_check_doh_OCSP : bool
- When set to true, cURL validates that the DoH server staples an OCSP response during the TLS handshake.
- $curl_check_OCSP : bool
- cURL extra hardening
- $curl_multi_options : array<int, mixed>
- options for the curl multi instance
- $curl_options : array<int, mixed>
- options for each curl instance
- $dns_over_https : string|null
- Sets a DNS-over-HTTPS provider URL
- $retries : int
- Number of retries (multi fetch)
- $sleep : int
- sleep timer (microseconds) between each fired multi request on startup
- $ssl_doh_verifypeer : bool
- requires either HTTPOptions::$ca_info or a properly working system CA file
- $ssl_verifypeer : bool
- requires either HTTPOptions::$ca_info or a properly working system CA file
- $timeout : int
- Timeout value
- $user_agent : string
- A custom user agent string
- $window_size : int
- maximum of concurrent requests for curl_multi
Properties
$ca_info
CA Root Certificates for use with CURL/SSL
public
string|null
$ca_info
= null
(if not configured in php.ini or available in a default path via the ca-certificates package)
Plese note: if you also set CURLOPT_CAINFO or CURLOPT_CAPATH in the $curl_options array,
these will take precedence and overwrite the value here.
Tags
$curl_check_doh_OCSP
When set to true, cURL validates that the DoH server staples an OCSP response during the TLS handshake.
public
bool
$curl_check_doh_OCSP
= false
Tags
$curl_check_OCSP
cURL extra hardening
public
bool
$curl_check_OCSP
= false
When set to true, cURL validates that the server staples an OCSP response during the TLS handshake.
Use with caution as cURL will refuse a connection if it doesn't receive a valid OCSP response - this does not necessarily mean that the TLS connection is insecure.
Tags
$curl_multi_options
options for the curl multi instance
public
array<int, mixed>
$curl_multi_options
= []
Tags
$curl_options
options for each curl instance
public
array<int, mixed>
$curl_options
= []
this array is being merged into the default options as the last thing before curl_exec(). none of the values (except existence of the CA file) will be checked - that's up to the implementation.
Hooks
public
set
$dns_over_https
Sets a DNS-over-HTTPS provider URL
public
string|null
$dns_over_https
= null
e.g.
- https://cloudflare-dns.com/dns-query
- https://dns.google/dns-query
- https://dns.nextdns.io
Tags
Hooks
public
set
Tags
Parameters
- $doh : string|null
$retries
Number of retries (multi fetch)
public
int
$retries
= 3
$sleep
sleep timer (microseconds) between each fired multi request on startup
public
int
$sleep
= 0
$ssl_doh_verifypeer
requires either HTTPOptions::$ca_info or a properly working system CA file
public
bool
$ssl_doh_verifypeer
= true
Tags
$ssl_verifypeer
requires either HTTPOptions::$ca_info or a properly working system CA file
public
bool
$ssl_verifypeer
= true
Tags
$timeout
Timeout value
public
int
$timeout
= 10
Tags
$user_agent
A custom user agent string
public
string
$user_agent
= 'chillerlanHttpInterface/6.0 +https://github.com/chillerlan/php-httpinterface'
Hooks
public
set
Tags
$window_size
maximum of concurrent requests for curl_multi
public
int
$window_size
= 5