ClientConfig¶
Canonical path: o6.ClientConfig
ClientConfig
¶
Configuration of one Client, reached as client.config.
The client owns its config; assign to these attributes instead of replacing the object. Most settings only take effect on the next connect, so configure the client before connecting.
See Everything else goes on client.config.
Attributes¶
endpoint
instance-attribute
¶
A complete EndpointDescription that pins the exact endpoint.
Usually taken from Client.getEndpoints(), and set instead of letting
the client select an endpoint from endpointUrl and the security
settings.
securityPolicyUri
instance-attribute
¶
Full URI of the security policy to request.
securityPolicy
instance-attribute
¶
Security policy as a short name, e.g. "Basic256Sha256".
An enum-friendly view of securityPolicyUri; the setter also accepts an
o6.SecurityPolicy member.
applicationUri
instance-attribute
¶
URI advertised in the ApplicationDescription.
On a secured channel this must match the URI inside the client certificate.
applicationDescription
instance-attribute
¶
The whole ApplicationDescription, for full control over discovery data.
userIdentityToken
instance-attribute
¶
User identity token sent on ActivateSession, as an ExtensionObject.
The setUsernamePassword and setAuthenticationCert methods fill this
in for the common cases.
userTokenPolicy
instance-attribute
¶
UserTokenPolicy that the identity token is encrypted for.
noSession
instance-attribute
¶
Operate on the SecureChannel alone, without creating a Session.
Set by Client.connectSecureChannel(); assigning it directly is not
how a channel-only connection is established.
noReconnect
instance-attribute
¶
Do not reconnect automatically after the connection is lost.
noNewSession
instance-attribute
¶
Do not create a replacement Session when the old one cannot be reused.
allowNonePolicyPassword
instance-attribute
¶
Permit a username/password token on an unencrypted channel.
Off by default, because it sends the password in clear text.
sessionName
instance-attribute
¶
Session name shown by the server's session diagnostics.
secureChannelLifeTime
instance-attribute
¶
Requested SecureChannel lifetime in milliseconds, before renewal.
requestedSessionTimeout
instance-attribute
¶
Requested Session timeout in milliseconds.
connectivityCheckInterval
instance-attribute
¶
Keepalive interval in milliseconds. 0 disables the check.
outstandingPublishRequests
instance-attribute
¶
How many Publish requests are kept in flight for subscriptions.
authSecurityPolicyUri
instance-attribute
¶
Security policy URI used to encrypt the user identity token.
Defaults to the channel's own policy.
maxTrustListSize
instance-attribute
¶
Byte limit for the trust list. 0 means no limit.
maxRejectedListSize
instance-attribute
¶
Maximum number of rejected certificates kept. 0 means no limit.
sessionLocaleIds
instance-attribute
¶
Preferred locale IDs for the Session, most preferred first.
namespaces
instance-attribute
¶
Namespace URIs the client itself declares, indexed as given.
localMaxMessageSize
instance-attribute
¶
Largest message the client accepts, in bytes. 0 means no limit.
localMaxChunkCount
instance-attribute
¶
Largest number of chunks the client accepts. 0 means no limit.
certificate
property
writable
¶
The client's own certificate, as DER bytes.
Accepts a path string, a Path, or raw DER or PEM bytes; reads back
as DER. Setting it stores the value until it is applied on connect.
privateKey
property
writable
¶
The client's own private key, as DER bytes.
Accepts a path string, a Path, or raw DER or PEM bytes.
trustList
property
writable
¶
Certificates the client trusts, as DER bytes.
Accepts path strings, Path objects, or raw DER or PEM bytes.
revocationList
property
writable
¶
Certificate revocation lists for trustList, as DER bytes.
Functions¶
setUsernamePassword
¶
Authenticate the session with a username and password.
On an unencrypted channel this needs allowNonePolicyPassword,
because the password would travel in clear text.
setEncryption
¶
Configure channel encryption in one call.
Equivalent to assigning certificate, privateKey, trustList, and
revocationList, but applied immediately rather than on connect.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
certificate
|
bytes
|
Client certificate, as DER or PEM bytes. |
required |
privateKey
|
bytes
|
Matching private key, as DER or PEM bytes. |
required |
trustList
|
list[bytes]
|
Trusted certificates, as DER or PEM bytes. |
required |
revocationList
|
list[bytes]
|
Certificate revocation lists. |
required |
Raises:
| Type | Description |
|---|---|
StatusCodeError
|
open62541 rejected the material. |
setAuthenticationCert
¶
Authenticate the session with an X.509 user certificate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
certificate
|
bytes
|
User certificate, as DER or PEM bytes. |
required |
privateKey
|
bytes
|
Matching private key, as DER or PEM bytes. |
required |
Raises:
| Type | Description |
|---|---|
StatusCodeError
|
open62541 rejected the material. |