CurlFactory
in package
implements
CurlFactoryInterface
Creates curl resources from a request
Tags
Table of Contents
Interfaces
Constants
- CURL_VERSION_STR : mixed = 'curl_version'
- LOW_CURL_VERSION_NUMBER : mixed = '7.21.2'
- DELEGATED_PROXY_TUNNEL_OWNER : mixed = 'proxy-tunnel:delegated-to-libcurl'
- STRINGABLE_PROXY_CREDENTIAL_OPTIONS : mixed = ['CURLOPT_PROXYUSERPWD', 'CURLOPT_PROXYUSERNAME...
- String-valued proxy credential cURL options whose values feed the connection-reuse section signatures. Stringable values are cast exactly once, before signature computation, so the signature and ext-curl observe the same string; a stateful __toString() could otherwise produce one value for the signature and a different one on the wire, giving two credentials the same section. Numeric options (CURLOPT_PROXYTYPE, CURLOPT_PROXY_SSLVERSION) and blob options (CURLOPT_PROXY_SSLCERT_BLOB) are deliberately excluded.
Properties
- $handles : array<string|int, resource>|array<string|int, CurlHandle>
- $maxHandles : int
- $opaqueShareConnectionCache : bool
- $poolMayHoldTunnels : bool
- $proxyTunnelOwner : string|null
- $shareHandle : resource|CurlShareHandle|null
- $shareMode : string
Methods
- __construct() : mixed
- __destruct() : mixed
- create() : EasyHandle
- Creates a cURL handle resource.
- finish() : PromiseInterface
- Completes a cURL transaction, either returning a response promise or a rejected promise.
- release() : void
- Release an easy handle, allowing it to be reused or closed.
- addConflictingCurlOption() : void
- addSupportedCurlOption() : void
- appendCurlProxyHeaders() : void
- applyBody() : void
- applyCurlOptions() : void
- applyHandlerOptions() : void
- applyHeaders() : void
- applyManagedProxyAuthorization() : void
- Routes the managed first-class Proxy-Authorization values to libcurl's proxy-only header channel, independently of Guzzle's proxy prediction: libcurl alone decides whether the proxy-only list is used for the actual transfer, so the credential can never reach an origin through CURLOPT_HTTPHEADER. Without proxy header separation support, values are safely omitted on known direct, bypassed, and SOCKS routes; a route that may use an HTTP(S) proxy is rejected before cURL initialization and network I/O. A deprecated raw CURLOPT_HTTPHEADER replacement suppresses every generated header, the managed values included.
- applyMethod() : void
- applyProxyAuthorizationHeaderHandling() : void
- applyTlsVersionRange() : void
- assertFinalProxyOptionTypes() : void
- assertRequiredMultiplexAuthSupported() : void
- libcurl forces NTLM-authenticated transfers onto HTTP/1.1: when the server picks NTLM from the offered mask, the connection is closed and the request is retried over HTTP/1.1 whatever HTTP version was asked for, silently defeating the required protocol guarantee on both cleartext and TLS routes. The final merged mask is checked so the deprecated "auth" request option and the raw CURLOPT_HTTPAUTH cURL option are both covered, and any mask permitting NTLM, such as CURLAUTH_ANY, is rejected because the selection is server-controlled.
- assertRequiredMultiplexRouteDirect() : void
- Required multiplexing sends cleartext requests with HTTP/2 prior knowledge, which an HTTP proxy hop silently downgrades, so the request must reach the origin directly. The check runs against the final merged cURL configuration because deprecated raw proxy options are applied after Guzzle's own decisions and may add, replace, or disable the selected proxy. Value types that ext-curl would coerce are rejected as ambiguous, and only the exact CURLOPT_NOPROXY wildcard '*' counts as disabling the primary proxy and pre-proxy: host-specific patterns are conservatively treated as leaving them active.
- assertRequiredMultiplexSupported() : void
- assertResolvedProxySupported() : void
- conflictingCurlOptions() : array<int, string|null>
- conflictingCurlOptionSinceOverrides() : array<int, string>
- createHeaderFn() : callable
- createRejection() : PromiseInterface
- curlMaxSslVersion() : int
- curlMinSslVersion() : int
- curlProtocolMask() : int
- curlProxyAuthorizationHeaderValues() : array<int, string>
- discardIdleHandles() : void
- finishError() : PromiseInterface
- forceFreshConnectionForAuthenticatedProxy() : void
- formatCurlOption() : string
- getDefaultConf() : array<int|string, mixed>
- getEffectiveProxy() : string|null
- hasAuthenticatedHttpProxyState() : bool
- hasAuthenticatedSocksProxyState() : bool
- hasCurlConnectTo() : bool
- hasCurlProxyAuthorizationHeader() : bool
- hasCurlProxyCredentials() : bool
- hasCurlProxyHeaderOption() : bool
- hasCurlProxyTlsCredentials() : bool
- hasRequestLevelCurlShare() : bool
- headersFromTrailerLines() : array<string|int, mixed>
- Parses validated trailer field lines into an associative array keyed by lowercased field name, preserving first-occurrence key order and wire value order.
- invokeStats() : void
- isCurlShareHandle() : bool
- isHttpProxyForConnectionReuse() : bool
- isolateOpaqueShareAnonymousProxyTunnel() : void
- isolatePreProxyOnAffectedCurl() : void
- isProxyAuthorizationHeaderLine() : bool
- isSocksProxy() : bool
- isSocksProxyType() : bool
- managedProxyAuthorizationHeaderLines() : array<int, string>
- normalizeCurlHeaderOptions() : void
- normalizeMultiplex() : string|null
- normalizeStringableProxyCredentialOptions() : void
- normalizeTlsFileType() : string
- proxyAuthorizationHeaderValue() : string|null
- proxyAuthorizationHeaderValuesFromList() : array<int, string>
- proxyScheme() : string|null
- proxyTunnelSignature() : string|null
- Computes the connection-reuse section signature for a proxy tunnel or SOCKS proxy, or null when the request does not require sectioning.
- redactProxyUserInfo() : string
- rejectRequestLevelShareConflict() : void
- rejectRequestLevelShareWithProxyAuth() : void
- removeHeader() : void
- Remove a header from the options array.
- requireCurlMaxSslVersion() : int
- requiresFreshConnectionForAuthenticatedProxy() : bool
- resolveProxy() : array{0: mixed, 1: string}
- retryFailedRewind() : PromiseInterface
- This function ensures that a response was set on a transaction. If one was not set, then the request is retried if possible. This error typically means you are sending a payload, curl encountered a "Connection died, retrying a fresh connect" error, tried to rewind the stream, and then encountered a "necessary data rewind wasn't possible" error, causing the request to be sent through curl_multi_info_read() without an error status.
- sanitizeCurlError() : string
- shouldValidateSslKeyFile() : bool
- socksProxySignature() : string|null
- Computes the connection-reuse section signature for a SOCKS proxy.
- supportedCurlOptions() : array<int, true>
- triggerConflictingCurlOptionDeprecations() : void
- triggerUnsupportedCurlOptionDeprecations() : void
- triggerUnsupportedRequestOptionDeprecations() : void
- usesProxyTunnel() : bool
- validateRequestUriScheme() : void
Constants
CURL_VERSION_STR
public
mixed
CURL_VERSION_STR
= 'curl_version'
LOW_CURL_VERSION_NUMBER
public
mixed
LOW_CURL_VERSION_NUMBER
= '7.21.2'
DELEGATED_PROXY_TUNNEL_OWNER
private
mixed
DELEGATED_PROXY_TUNNEL_OWNER
= 'proxy-tunnel:delegated-to-libcurl'
STRINGABLE_PROXY_CREDENTIAL_OPTIONS
String-valued proxy credential cURL options whose values feed the connection-reuse section signatures. Stringable values are cast exactly once, before signature computation, so the signature and ext-curl observe the same string; a stateful __toString() could otherwise produce one value for the signature and a different one on the wire, giving two credentials the same section. Numeric options (CURLOPT_PROXYTYPE, CURLOPT_PROXY_SSLVERSION) and blob options (CURLOPT_PROXY_SSLCERT_BLOB) are deliberately excluded.
private
mixed
STRINGABLE_PROXY_CREDENTIAL_OPTIONS
= ['CURLOPT_PROXYUSERPWD', 'CURLOPT_PROXYUSERNAME', 'CURLOPT_PROXYPASSWORD', 'CURLOPT_PROXY_SSLCERT', 'CURLOPT_PROXY_SSLKEY', 'CURLOPT_PROXY_KEYPASSWD', 'CURLOPT_PROXY_TLSAUTH_USERNAME', 'CURLOPT_PROXY_TLSAUTH_PASSWORD']
Properties
$handles
private
array<string|int, resource>|array<string|int, CurlHandle>
$handles
= []
$maxHandles
private
int
$maxHandles
Total number of idle handles to keep in cache
$opaqueShareConnectionCache
private
bool
$opaqueShareConnectionCache
= false
Whether the configured share handle may own a connection cache populated outside this factory
$poolMayHoldTunnels
private
bool
$poolMayHoldTunnels
= false
Whether an in-domain handle has been pooled since the last purge
$proxyTunnelOwner
private
string|null
$proxyTunnelOwner
Owner signature of the proxy tunnels that pooled idle handles may still hold
$shareHandle
private
resource|CurlShareHandle|null
$shareHandle
$shareMode
private
string
$shareMode
Methods
__construct()
public
__construct(int $maxHandles[, string $shareMode = TransportSharing::NONE ][, resource|CurlShareHandle|CurlShareHandleState|null $shareHandle = null ]) : mixed
Parameters
- $maxHandles : int
-
Maximum number of idle handles.
- $shareMode : string = TransportSharing::NONE
- $shareHandle : resource|CurlShareHandle|CurlShareHandleState|null = null
__destruct()
public
__destruct() : mixed
create()
Creates a cURL handle resource.
public
create(RequestInterface $request, array<string|int, mixed> $options) : EasyHandle
Parameters
- $request : RequestInterface
-
Request
- $options : array<string|int, mixed>
-
Transfer options
Return values
EasyHandlefinish()
Completes a cURL transaction, either returning a response promise or a rejected promise.
public
static finish(callable(RequestInterface, array<string|int, mixed>): PromiseInterface $handler, EasyHandle $easy, CurlFactoryInterface $factory) : PromiseInterface
Parameters
- $handler : callable(RequestInterface, array<string|int, mixed>): PromiseInterface
- $easy : EasyHandle
- $factory : CurlFactoryInterface
-
Dictates how the handle is released
Return values
PromiseInterfacerelease()
Release an easy handle, allowing it to be reused or closed.
public
release(EasyHandle $easy) : void
This function must call unset on the easy handle's "handle" property.
Parameters
- $easy : EasyHandle
addConflictingCurlOption()
private
static addConflictingCurlOption(array<int, string|null> &$options, string $constant, string|null $replacement) : void
Parameters
- $options : array<int, string|null>
- $constant : string
- $replacement : string|null
addSupportedCurlOption()
private
static addSupportedCurlOption(array<int, true> &$options, string $constant) : void
Parameters
- $options : array<int, true>
- $constant : string
appendCurlProxyHeaders()
private
static appendCurlProxyHeaders(array<int|string, mixed> &$conf, array<int, string> $headers) : void
Parameters
- $conf : array<int|string, mixed>
- $headers : array<int, string>
applyBody()
private
applyBody(RequestInterface $request, array<string|int, mixed> $options, array<string|int, mixed> &$conf) : void
Parameters
- $request : RequestInterface
- $options : array<string|int, mixed>
- $conf : array<string|int, mixed>
applyCurlOptions()
private
applyCurlOptions(resource|CurlHandle $handle, array<int|string, mixed> $conf) : void
Parameters
- $handle : resource|CurlHandle
- $conf : array<int|string, mixed>
applyHandlerOptions()
private
applyHandlerOptions(EasyHandle $easy, array<string|int, mixed> &$conf) : void
Parameters
- $easy : EasyHandle
- $conf : array<string|int, mixed>
applyHeaders()
private
applyHeaders(EasyHandle $easy, array<string|int, mixed> &$conf) : void
Parameters
- $easy : EasyHandle
- $conf : array<string|int, mixed>
applyManagedProxyAuthorization()
Routes the managed first-class Proxy-Authorization values to libcurl's proxy-only header channel, independently of Guzzle's proxy prediction: libcurl alone decides whether the proxy-only list is used for the actual transfer, so the credential can never reach an origin through CURLOPT_HTTPHEADER. Without proxy header separation support, values are safely omitted on known direct, bypassed, and SOCKS routes; a route that may use an HTTP(S) proxy is rejected before cURL initialization and network I/O. A deprecated raw CURLOPT_HTTPHEADER replacement suppresses every generated header, the managed values included.
private
static applyManagedProxyAuthorization(RequestInterface $request, array<int|string, mixed> &$conf, array<int, string> $headers, bool $rawHttpHeadersReplaceManaged) : void
Parameters
- $request : RequestInterface
- $conf : array<int|string, mixed>
- $headers : array<int, string>
- $rawHttpHeadersReplaceManaged : bool
applyMethod()
private
applyMethod(EasyHandle $easy, array<string|int, mixed> &$conf) : void
Parameters
- $easy : EasyHandle
- $conf : array<string|int, mixed>
applyProxyAuthorizationHeaderHandling()
private
static applyProxyAuthorizationHeaderHandling(RequestInterface $request, array<int|string, mixed> &$conf) : void
Parameters
- $request : RequestInterface
- $conf : array<int|string, mixed>
applyTlsVersionRange()
private
applyTlsVersionRange(EasyHandle $easy, array<string|int, mixed> &$conf) : void
Parameters
- $easy : EasyHandle
- $conf : array<string|int, mixed>
assertFinalProxyOptionTypes()
private
static assertFinalProxyOptionTypes(array<int|string, mixed> $conf, bool $requiredCleartextMultiplex) : void
Parameters
- $conf : array<int|string, mixed>
- $requiredCleartextMultiplex : bool
assertRequiredMultiplexAuthSupported()
libcurl forces NTLM-authenticated transfers onto HTTP/1.1: when the server picks NTLM from the offered mask, the connection is closed and the request is retried over HTTP/1.1 whatever HTTP version was asked for, silently defeating the required protocol guarantee on both cleartext and TLS routes. The final merged mask is checked so the deprecated "auth" request option and the raw CURLOPT_HTTPAUTH cURL option are both covered, and any mask permitting NTLM, such as CURLAUTH_ANY, is rejected because the selection is server-controlled.
private
static assertRequiredMultiplexAuthSupported(array<int|string, mixed> $conf) : void
Parameters
- $conf : array<int|string, mixed>
assertRequiredMultiplexRouteDirect()
Required multiplexing sends cleartext requests with HTTP/2 prior knowledge, which an HTTP proxy hop silently downgrades, so the request must reach the origin directly. The check runs against the final merged cURL configuration because deprecated raw proxy options are applied after Guzzle's own decisions and may add, replace, or disable the selected proxy. Value types that ext-curl would coerce are rejected as ambiguous, and only the exact CURLOPT_NOPROXY wildcard '*' counts as disabling the primary proxy and pre-proxy: host-specific patterns are conservatively treated as leaving them active.
private
static assertRequiredMultiplexRouteDirect(EasyHandle $easy, array<int|string, mixed> $conf) : void
Parameters
- $easy : EasyHandle
- $conf : array<int|string, mixed>
assertRequiredMultiplexSupported()
private
static assertRequiredMultiplexSupported(EasyHandle $easy) : void
Parameters
- $easy : EasyHandle
assertResolvedProxySupported()
private
static assertResolvedProxySupported(RequestInterface $request, mixed $proxyConf) : void
Parameters
- $request : RequestInterface
- $proxyConf : mixed
conflictingCurlOptions()
private
static conflictingCurlOptions() : array<int, string|null>
Return values
array<int, string|null>conflictingCurlOptionSinceOverrides()
private
static conflictingCurlOptionSinceOverrides() : array<int, string>
Return values
array<int, string>createHeaderFn()
private
createHeaderFn(EasyHandle $easy) : callable
Parameters
- $easy : EasyHandle
Return values
callablecreateRejection()
private
static createRejection(EasyHandle $easy, array<string|int, mixed> $ctx) : PromiseInterface
Parameters
- $easy : EasyHandle
- $ctx : array<string|int, mixed>
Return values
PromiseInterfacecurlMaxSslVersion()
private
static curlMaxSslVersion(mixed $value) : int
Parameters
- $value : mixed
Return values
intcurlMinSslVersion()
private
static curlMinSslVersion(mixed $value) : int
Parameters
- $value : mixed
Return values
intcurlProtocolMask()
private
static curlProtocolMask(array<string|int, string> $protocols) : int
Parameters
- $protocols : array<string|int, string>
Return values
intcurlProxyAuthorizationHeaderValues()
private
static curlProxyAuthorizationHeaderValues(array<int|string, mixed> $conf) : array<int, string>
Parameters
- $conf : array<int|string, mixed>
Return values
array<int, string>discardIdleHandles()
private
discardIdleHandles() : void
finishError()
private
static finishError(callable(RequestInterface, array<string|int, mixed>): PromiseInterface $handler, EasyHandle $easy, CurlFactoryInterface $factory) : PromiseInterface
Parameters
- $handler : callable(RequestInterface, array<string|int, mixed>): PromiseInterface
- $easy : EasyHandle
- $factory : CurlFactoryInterface
Return values
PromiseInterfaceforceFreshConnectionForAuthenticatedProxy()
private
static forceFreshConnectionForAuthenticatedProxy(RequestInterface $request, array<int|string, mixed> &$conf) : void
Parameters
- $request : RequestInterface
- $conf : array<int|string, mixed>
formatCurlOption()
private
static formatCurlOption(int|string $option) : string
Parameters
- $option : int|string
Return values
stringgetDefaultConf()
private
getDefaultConf(EasyHandle $easy) : array<int|string, mixed>
Parameters
- $easy : EasyHandle
Return values
array<int|string, mixed>getEffectiveProxy()
private
static getEffectiveProxy(array<int|string, mixed> $conf) : string|null
Parameters
- $conf : array<int|string, mixed>
Return values
string|nullhasAuthenticatedHttpProxyState()
private
static hasAuthenticatedHttpProxyState(string $proxy, array<int|string, mixed> $conf) : bool
Parameters
- $proxy : string
- $conf : array<int|string, mixed>
Return values
boolhasAuthenticatedSocksProxyState()
private
static hasAuthenticatedSocksProxyState(string $proxy, array<int|string, mixed> $conf) : bool
Parameters
- $proxy : string
- $conf : array<int|string, mixed>
Return values
boolhasCurlConnectTo()
private
static hasCurlConnectTo(array<int|string, mixed> $conf) : bool
Parameters
- $conf : array<int|string, mixed>
Return values
boolhasCurlProxyAuthorizationHeader()
private
static hasCurlProxyAuthorizationHeader(array<int|string, mixed> $conf) : bool
Parameters
- $conf : array<int|string, mixed>
Return values
boolhasCurlProxyCredentials()
private
static hasCurlProxyCredentials(array<int|string, mixed> $conf) : bool
Parameters
- $conf : array<int|string, mixed>
Return values
boolhasCurlProxyHeaderOption()
private
static hasCurlProxyHeaderOption(array<int|string, mixed> $conf) : bool
Parameters
- $conf : array<int|string, mixed>
Return values
boolhasCurlProxyTlsCredentials()
private
static hasCurlProxyTlsCredentials(array<int|string, mixed> $conf) : bool
Parameters
- $conf : array<int|string, mixed>
Return values
boolhasRequestLevelCurlShare()
private
static hasRequestLevelCurlShare(array<string|int, mixed> $options) : bool
Parameters
- $options : array<string|int, mixed>
Return values
boolheadersFromTrailerLines()
Parses validated trailer field lines into an associative array keyed by lowercased field name, preserving first-occurrence key order and wire value order.
private
static headersFromTrailerLines(array<string|int, mixed> $lines) : array<string|int, mixed>
Parameters
- $lines : array<string|int, mixed>
Return values
array<string|int, mixed>invokeStats()
private
static invokeStats(EasyHandle $easy) : void
Parameters
- $easy : EasyHandle
isCurlShareHandle()
private
static isCurlShareHandle(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolisHttpProxyForConnectionReuse()
private
static isHttpProxyForConnectionReuse(string $proxy, array<int|string, mixed> $conf) : bool
Parameters
- $proxy : string
- $conf : array<int|string, mixed>
Return values
boolisolateOpaqueShareAnonymousProxyTunnel()
private
isolateOpaqueShareAnonymousProxyTunnel(RequestInterface $request, array<int|string, mixed> &$conf) : void
Parameters
- $request : RequestInterface
- $conf : array<int|string, mixed>
isolatePreProxyOnAffectedCurl()
private
static isolatePreProxyOnAffectedCurl(array<int|string, mixed> &$conf) : void
Parameters
- $conf : array<int|string, mixed>
isProxyAuthorizationHeaderLine()
private
static isProxyAuthorizationHeaderLine(string $header) : bool
Parameters
- $header : string
Return values
boolisSocksProxy()
private
static isSocksProxy(string $proxy, array<int|string, mixed> $conf) : bool
Parameters
- $proxy : string
- $conf : array<int|string, mixed>
Return values
boolisSocksProxyType()
private
static isSocksProxyType(mixed $proxyType) : bool
Parameters
- $proxyType : mixed
Return values
boolmanagedProxyAuthorizationHeaderLines()
private
static managedProxyAuthorizationHeaderLines(RequestInterface $request) : array<int, string>
Parameters
- $request : RequestInterface
Return values
array<int, string>normalizeCurlHeaderOptions()
private
static normalizeCurlHeaderOptions(array<int|string, mixed> &$conf) : void
Parameters
- $conf : array<int|string, mixed>
normalizeMultiplex()
private
static normalizeMultiplex(array<string|int, mixed> $options) : string|null
Parameters
- $options : array<string|int, mixed>
Return values
string|nullnormalizeStringableProxyCredentialOptions()
private
static normalizeStringableProxyCredentialOptions(array<int|string, mixed> &$conf) : void
Parameters
- $conf : array<int|string, mixed>
normalizeTlsFileType()
private
static normalizeTlsFileType(string $option, mixed $type) : string
Parameters
- $option : string
- $type : mixed
Return values
stringproxyAuthorizationHeaderValue()
private
static proxyAuthorizationHeaderValue(string $header) : string|null
Parameters
- $header : string
Return values
string|nullproxyAuthorizationHeaderValuesFromList()
private
static proxyAuthorizationHeaderValuesFromList(array<string|int, mixed> $headers) : array<int, string>
Parameters
- $headers : array<string|int, mixed>
Return values
array<int, string>proxyScheme()
private
static proxyScheme(string $proxy) : string|null
Parameters
- $proxy : string
Return values
string|nullproxyTunnelSignature()
Computes the connection-reuse section signature for a proxy tunnel or SOCKS proxy, or null when the request does not require sectioning.
private
static proxyTunnelSignature(RequestInterface $request, array<int|string, mixed> $conf) : string|null
Parameters
- $request : RequestInterface
- $conf : array<int|string, mixed>
Return values
string|nullredactProxyUserInfo()
private
static redactProxyUserInfo(string $error, string|null $proxy) : string
Parameters
- $error : string
- $proxy : string|null
Return values
stringrejectRequestLevelShareConflict()
private
rejectRequestLevelShareConflict(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
rejectRequestLevelShareWithProxyAuth()
private
static rejectRequestLevelShareWithProxyAuth(RequestInterface $request, array<string|int, mixed> $options, array<int|string, mixed> $conf) : void
Parameters
- $request : RequestInterface
- $options : array<string|int, mixed>
- $conf : array<int|string, mixed>
removeHeader()
Remove a header from the options array.
private
removeHeader(string $name, array<string|int, mixed> &$options) : void
Parameters
- $name : string
-
Case-insensitive header to remove
- $options : array<string|int, mixed>
-
Array of options to modify
requireCurlMaxSslVersion()
private
static requireCurlMaxSslVersion(string $constant) : int
Parameters
- $constant : string
Return values
intrequiresFreshConnectionForAuthenticatedProxy()
private
static requiresFreshConnectionForAuthenticatedProxy(RequestInterface $request, string $proxy, array<int|string, mixed> $conf) : bool
Parameters
- $request : RequestInterface
- $proxy : string
- $conf : array<int|string, mixed>
Return values
boolresolveProxy()
private
static resolveProxy(RequestInterface $request, array<string|int, mixed> $options) : array{0: mixed, 1: string}
Parameters
- $request : RequestInterface
- $options : array<string|int, mixed>
Return values
array{0: mixed, 1: string}retryFailedRewind()
This function ensures that a response was set on a transaction. If one was not set, then the request is retried if possible. This error typically means you are sending a payload, curl encountered a "Connection died, retrying a fresh connect" error, tried to rewind the stream, and then encountered a "necessary data rewind wasn't possible" error, causing the request to be sent through curl_multi_info_read() without an error status.
private
static retryFailedRewind(callable(RequestInterface, array<string|int, mixed>): PromiseInterface $handler, EasyHandle $easy, array<string|int, mixed> $ctx) : PromiseInterface
Parameters
- $handler : callable(RequestInterface, array<string|int, mixed>): PromiseInterface
- $easy : EasyHandle
- $ctx : array<string|int, mixed>
Return values
PromiseInterfacesanitizeCurlError()
private
static sanitizeCurlError(string $error, UriInterface $uri[, string|null $proxy = null ]) : string
Parameters
- $error : string
- $uri : UriInterface
- $proxy : string|null = null
Return values
stringshouldValidateSslKeyFile()
private
static shouldValidateSslKeyFile(string|null $type) : bool
Parameters
- $type : string|null
Return values
boolsocksProxySignature()
Computes the connection-reuse section signature for a SOCKS proxy.
private
static socksProxySignature(string $proxy, array<int|string, mixed> $conf) : string|null
libcurl compares SOCKS credentials on connection reuse from 7.69.0 (curl #4835), so no sectioning is needed there. Older libcurl matches a SOCKS proxy by type, host, and port only, so every SOCKS request is sectioned by its credential state; hashing the credential-less state too keeps an unauthenticated request from inheriting an authenticated connection.
Parameters
- $proxy : string
- $conf : array<int|string, mixed>
Return values
string|nullsupportedCurlOptions()
private
static supportedCurlOptions() : array<int, true>
Return values
array<int, true>triggerConflictingCurlOptionDeprecations()
private
static triggerConflictingCurlOptionDeprecations(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
triggerUnsupportedCurlOptionDeprecations()
private
static triggerUnsupportedCurlOptionDeprecations(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
triggerUnsupportedRequestOptionDeprecations()
private
static triggerUnsupportedRequestOptionDeprecations(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
usesProxyTunnel()
private
static usesProxyTunnel(RequestInterface $request, array<int|string, mixed> $conf) : bool
Parameters
- $request : RequestInterface
- $conf : array<int|string, mixed>
Return values
boolvalidateRequestUriScheme()
private
static validateRequestUriScheme(RequestInterface $request) : void
Parameters
- $request : RequestInterface