Documentation

HTTPOptions extends SettingsContainerAbstract
in package
Uses 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

$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
see
CURLOPT_SSL_VERIFYSTATUS

$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.

$sleep

sleep timer (microseconds) between each fired multi request on startup

protected int $sleep = 0

$timeout

Timeout value

protected int $timeout = 10
Tags
see
CURLOPT_TIMEOUT

$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
throws
ClientException

set_user_agent()

protected set_user_agent(string $user_agent) : void
Parameters
$user_agent : string
Tags
throws
ClientExceptionInterface

        
On this page

Search results