`HttpsTransport`
HttpsTransport — implements ClientTransportInterface for opc.https://, plugs into ClientBuilder::setTransport(), and orchestrates the HTTPS round-trips.
Fully qualified name: PhpOpcua\Client\ExtTransportHttps\HttpsTransport.
Implements PhpOpcua\Client\Transport\ClientTransportInterface.
Constructor
__construct(HttpClientInterface \$httpClient, HttpsEncodingStrategy \$encoding, string \$endpointUrl, float \$timeoutSeconds = 30.0, ?LoggerInterface \$logger = null, ?EventDispatcherInterface \$dispatcher = null)
httpClient
Backend that performs the POSTs. CurlHttpClient is shipped; PSR-18
wrappers are user-supplied.
encoding
The wire encoding. v4.4 ships BinaryHttpsEncoding (production-ready, see HTTPS Binary status) and JsonHttpsEncoding (foundation shipped, see HTTPS JSON status). XML SOAP and legacy SOAP/HTTP are roadmap.
endpointUrl
opc.https://host:port/path or https://host:port/path. The
constructor normalises opc.https:// to https://. Invalid scheme
raises HttpsTransportException.
timeoutSeconds
Per-request hard upper bound passed to the HTTP client.
logger
Optional PSR-3 logger. Defaults to NullLogger.
dispatcher
Optional PSR-14 dispatcher. When null, events are not emitted.
Methods inherited from ClientTransportInterface
connect(string \$host, int \$port, ?float \$timeout = null): void
No-op — HTTPS is stateless. Throws ConnectionException if close()
was called.
send(string \$data): void
If the frame starts with HEL, asks the encoding for a fake ACK and
stores it; otherwise encodes the request via encodeRequest() and
POSTs.
receive(): string
Returns the pending fake ACK if any, then the decoded HTTP response (re-wrapped in a synthetic UA-TCP frame).
setReceiveBufferSize(int \$size): void
Cap for the re-framed response size. Triggers ProtocolException on
receive() when exceeded.
close(): void
Releases the HTTP client. Idempotent.
isConnected(): bool
true until close() is called.
createProbe(): self
Returns a fresh HttpsTransport sharing the same HTTP client /
encoding / endpoint, for use as the discovery probe.
isSecureChannelExternal(): bool
Always true — TLS is the secure channel, the core skips
OpenSecureChannel.
Events dispatched
When a dispatcher is supplied:
HttpsRequestSent— before the POST (url,contentType,bodyLength).HttpsResponseReceived— after a 2xx response, before decoding (url,statusCode,bodyLength).HttpsRequestFailed— on network failure (statusCode=0) or non-2xx (statusCode=<actual>), with the originating exception incause.
Logging
INFO— none in the default path (HTTPS is too verbose; emit at application level if needed).WARNING— non-2xx response; event-dispatcher throw caught.ERROR—HttpsRequestExceptionfrom the HTTP backend.
Not thread-safe
The transport owns mutable buffers (pendingAck, pendingResponse);
use one instance per Client.