opcua-client-ext-transport-https · v4.4.x
Docs · Getting started

Quick start

Build an HttpsTransport, wire it into ClientBuilder, and connect to an opc.https:// endpoint. Three steps.

  1. 01

    Build the transport

    Both opc.https:// and plain https:// URLs are accepted as endpointUrl; the constructor normalises to https:// internally.

  2. 02

    Plug it into `ClientBuilder`

    The Client::connect() flow detects the external secure channel via HttpsTransport::isSecureChannelExternal() === true and skips the OpenSecureChannel handshake. TLS is the secure channel. Username/Password identity is used here because UA-.NETStandard filters Anonymous out of HTTPS endpoints when mTLS is off.

  3. 03

    Use the client as usual

    Every OPC UA service call becomes one HTTPS POST under the hood.

With mutual TLS

php mTLS configuration
$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.