Skip to main content

OPC UA client certificates

An OPC UA Sign or SignAndEncrypt channel requires a client certificate and matching private key, with trust approved by the Server administrator. The certificate SAN must include URI:urn:taosx-opc:client. Check connectivity after uploading. A channel certificate does not replace user authorization.

Entry point: PowerShell or Bash on the certificate preparation host; taosExplorer → Data Ingestion → OPC UA → Connection Configuration; the OPC UA Server's certificate trust management page.

info

Security modes Sign and SignAndEncrypt require a client certificate and matching private key, and the Server administrator must trust the certificate. Secure channel certificates establish signed or encrypted channels, while user authentication determines the access identity. Configure the two separately.

1. Prerequisites​

  • Prepare the OpenSSL command-line tool and run openssl version to confirm availability. Windows can also use C:\Program Files\Git\usr\bin\openssl.exe bundled with Git for Windows.
  • Use PEM format for the certificate and private key. A server certificate downloaded from the Server, a DER file, or a PKCS#12 file cannot be entered directly in the client certificate field.
  • The client application URI is urn:taosx-opc:client. The certificate's Subject Alternative Name (SAN) must include URI:urn:taosx-opc:client.
  • Have the security administrator confirm the algorithm, validity period, issuer, and private-key custody method. The following self-signed, 365-day example is for isolated integration testing. In production, issue certificates according to organizational policy; this example validity period is not a product requirement.

2. Generate the certificate and private key​

tip

Certificates can be generated on a separate preparation host; this does not need to run on the taosX host. The commands below create a new directory and stop if it already exists, avoiding overwriting a private key in use. The generated private key has no passphrase. Restrict access to the relevant administrators and upload it through a protected channel.

Run in Bash. umask 077 restricts new files to the current account. Do not store private keys in shared directories.

set -e
umask 077
certificate_directory="$HOME/taosx-opcua-certificate"
mkdir "$certificate_directory"
cat > "$certificate_directory/client.cnf" <<'EOF'
[req]
distinguished_name = req_dn
x509_extensions = v3_ext
prompt = no
[req_dn]
CN = taosx-opc-client
O = TDengine
[v3_ext]
basicConstraints = CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
extendedKeyUsage = clientAuth, serverAuth
subjectAltName = URI:urn:taosx-opc:client
EOF
openssl req -x509 -newkey rsa:2048 -nodes -days 365 \
-config "$certificate_directory/client.cnf" \
-out "$certificate_directory/client_cert.pem" \
-keyout "$certificate_directory/client_key.pem"
openssl x509 -in "$certificate_directory/client_cert.pem" -noout -subject -dates -ext subjectAltName
openssl x509 -in "$certificate_directory/client_cert.pem" -noout -fingerprint -sha1

Check that the output includes URI:urn:taosx-opc:client and that the current time falls within the certificate validity period. The SHA1 fingerprint is only used by some vendor interfaces to identify and bind certificates; it is not a recommendation to use SHA1 as a signature algorithm.

3. Upload and establish trust​

  1. In the OPC UA task's Connection Configuration, upload client_cert.pem to Secure Channel Certificate and client_key.pem to Certificate's Private Key. These are the corresponding labels in the English interface.
  2. Match security mode and security policy to the Server endpoint. Then separately select anonymous, username/password, or user-certificate authentication. Select anonymous only when the source explicitly allows it.
  3. Run a connectivity check. A Server may reject a new certificate before it is trusted. A first failed check alone does not establish that the certificate is invalid.
  4. Ask the Server administrator to check the subject, SAN, fingerprint, and validity period. Approve the client certificate and complete any required user association using Connect to Ignition OPC UA Server or Connect to GE CSS OPC UA Server.
  5. Check connectivity again, browse an authorized test Point, and start small-scope collection. Check the target value and source time. Connectivity does not replace read and write verification.

3.1 CLI certificate files and user identities​

For ingestion through taosx run, use certificate and private_key for channel certificates and keys, and auth_certificate and auth_private_key for user certificates and keys. Specify each file with @ followed by a controlled absolute path on the actual collection host. Encode paths according to DSN rules and quote the complete DSN for the shell. Beyond file existence, verify PEM loading, matching private keys, application URI, validity, and source trust. Do not treat a path on the browser host as a file on a remote taosX-Agent.

For user-certificate authentication, do not also supply a DSN username/password. Provide both the user certificate and its private key. Putting raw PEM text directly in a user-certificate field does not guarantee selection of a user-certificate identity. For the CLI, prefer the @文件路径 form above. Base64, a plain filename, or a server certificate is not the same file representation. After an anonymous endpoint connection succeeds, separately verify authorization for the user-certificate identity. For complete parameters and entry-point differences, see OPC UA connection parameters.

4. Troubleshooting and renewal​

SymptomCheck and action
StatusBadCertificateUriInvalidCheck the URI in SAN rather than only changing the subject CN. Reestablish trust after reissuing.
PEM or private-key loading failsConfirm that the upload is PEM with its matching private key, not a server certificate, DER file, or key from another certificate pair.
StatusBadSecurityChecksFailedCheck mode, policy, certificate trust, validity, and host clocks individually. Do not bypass production security policy by disabling it.
Channel succeeds but access is deniedContinue checking user authentication, source account, and Point permissions. Replacing the channel certificate repeatedly does not solve all permission problems.

Certificate renewal changes the identity material that must be trusted. Retain the current configuration before maintenance. Approve the new certificate first, then update and verify the task according to the maintenance plan. For rollback, use a paired copy of the original certificate and private key. Do not include private keys in screenshots, logs, support attachments, or version control.

For other task, write, and runtime problems, see Troubleshooting by symptom.