Quick start
Build an HttpsTransport, wire it into ClientBuilder, and connect to an opc.https:// endpoint. Three steps.
-
01
Build the transport
Both
opc.https://and plainhttps://URLs are accepted asendpointUrl; the constructor normalises tohttps://internally. -
02
Plug it into `ClientBuilder`
The
Client::connect()flow detects the external secure channel viaHttpsTransport::isSecureChannelExternal() === trueand skips theOpenSecureChannelhandshake. TLS is the secure channel. Username/Password identity is used here because UA-.NETStandard filters Anonymous out of HTTPS endpoints when mTLS is off. -
03
Use the client as usual
Every OPC UA service call becomes one HTTPS POST under the hood.
With mutual TLS
$transport = new HttpsTransport(
httpClient: new CurlHttpClient(
verifyTls: true,
caBundle: '/etc/ssl/certs/ca-bundle.crt',
clientCertPath: '/certs/client.pem',
clientKeyPath: '/certs/client.key',
clientKeyPassword: getenv('CLIENT_KEY_PASS') ?: null,
),
encoding: new BinaryHttpsEncoding(),
endpointUrl: 'opc.https://server.example:443/UA/',
);
Note
setClientCertificate() on the builder is for OPC UA application-level
certificates; mTLS cert / key for the TLS layer go on CurlHttpClient.