HTTPOptionsTrait
Table of Contents
Properties
- $ca_info : string|null
- CA Root Certificates for use with CURL/SSL
- $curl_check_OCSP : bool
- cURL extra hardening
- $curl_multi_options : array<string|int, mixed>
- options for the curl multi instance
- $curl_options : array<string|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_verifypeer : bool
- see CURLOPT_SSL_VERIFYPEER 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
Methods
- set_curl_options() : void
- set_dns_over_https() : void
- set_user_agent() : void
Properties
$ca_info
CA Root Certificates for use with CURL/SSL
protected
string|null
$ca_info
= null
(if not configured in php.ini or available in a default path via the ca-certificates
package)
Tags
$curl_check_OCSP
cURL extra hardening
protected
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
protected
array<string|int, mixed>
$curl_multi_options
= []
Tags
$curl_options
options for each curl instance
protected
array<string|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.
$dns_over_https
Sets a DNS-over-HTTPS provider URL
protected
string|null
$dns_over_https
= null
e.g.
- https://cloudflare-dns.com/dns-query
- https://dns.google/dns-query
- https://dns.nextdns.io
Tags
$retries
Number of retries (multi fetch)
protected
int
$retries
= 3
$sleep
sleep timer (microseconds) between each fired multi request on startup
protected
int
$sleep
= 0
$ssl_verifypeer
see CURLOPT_SSL_VERIFYPEER requires either HTTPOptions::$ca_info or a properly working system CA file
protected
bool
$ssl_verifypeer
= true
Tags
$timeout
Timeout value
protected
int
$timeout
= 10
Tags
$user_agent
A custom user agent string
protected
string
$user_agent
= 'chillerlanHttpInterface/6.0 +https://github.com/chillerlan/php-httpinterface'
$window_size
maximum of concurrent requests for curl_multi
protected
int
$window_size
= 5
Methods
set_curl_options()
protected
set_curl_options(array<string|int, mixed> $curl_options) : void
Parameters
- $curl_options : array<string|int, mixed>
set_dns_over_https()
protected
set_dns_over_https(string|null $dns_over_https) : void
Parameters
- $dns_over_https : string|null
Tags
set_user_agent()
protected
set_user_agent(string $user_agent) : void
Parameters
- $user_agent : string