OPC UA security: modes, policies, certificates — and why a certificate is rejected
Security modes and policies, application instance certificates, trust lists, user authentication and a checklist for the most common connection failures.
Two layers
- Secure channel (application authentication, message signing and encryption) — chosen by security mode and security policy.
- User authentication inside the session — Anonymous, UserName/password, X.509 user certificate or issued token (e.g. JWT).
Security modes
| Mode | Messages | Use |
|---|---|---|
| None | No signing, no encryption | Isolated tests only |
| Sign | Signed (integrity), readable on the wire | Rare; protects against tampering |
| SignAndEncrypt | Signed and encrypted | Recommended for production |
Security policies
A policy is a fixed set of algorithms. Current RSA-based policies:
| Policy | Symmetric | Asymmetric signature | Key size | Status |
|---|---|---|---|---|
| Basic128Rsa15 | AES-128-CBC, HMAC-SHA1 | RSA PKCS#1 v1.5 SHA-1 | 1024–2048 | deprecated |
| Basic256 | AES-256-CBC, HMAC-SHA1 | RSA PKCS#1 v1.5 SHA-1 | 1024–2048 | deprecated |
| Aes128_Sha256_RsaOaep | AES-128-CBC, HMAC-SHA256 | RSA PKCS#1 v1.5 SHA-256 | 2048–4096 | current |
| Basic256Sha256 | AES-256-CBC, HMAC-SHA256 | RSA PKCS#1 v1.5 SHA-256 | 2048–4096 | current |
| Aes256_Sha256_RsaPss | AES-256-CBC, HMAC-SHA256 | RSA-PSS SHA-256 | 2048–4096 | current |
Version 1.05 adds elliptic-curve policies (ECC_nistP256, ECC_nistP384, brainpool and curve25519/448 variants). Both sides must support the policy; the server offers its list in the endpoints.
Application instance certificates
Every client and server has an X.509 certificate. Important fields:
- Subject Alternative Name — URI must equal the application's ApplicationUri;
- SAN DNS names / IP addresses of a server must contain the hostname the client uses;
- validity period, key length matching the policy, key usage.
Each application keeps folders such as trusted, rejected and issuers. An unknown certificate lands in rejected until an administrator moves it to trusted (or trusts the issuing CA).
Why a certificate is rejected — checklist
| Symptom / status | Likely cause | What to do |
|---|---|---|
BadCertificateUntrusted | Peer certificate not in the trust list | Move it from rejected to trusted on the receiving side |
BadCertificateTimeInvalid | Expired / not yet valid, or wrong clock | Check PLC/PC time; renew the certificate |
BadCertificateHostNameInvalid | Hostname/IP in endpoint URL not in SAN | Connect with the name in the certificate or regenerate |
BadCertificateUriInvalid | SAN URI ≠ ApplicationUri | Regenerate the certificate with the right URI |
BadSecurityPolicyRejected | Policy not allowed / key too short | Choose a policy both sides enable |
BadIdentityTokenRejected | User/password or user certificate refused | Check user management on the server |
Trust both ways: the server must trust the client and the client must trust the server.
Connections
Open in Knowledge Graph →Loading the map…
Sources
- OPC 10000-2 Part 2: Security Model (v1.05) — OPC Foundation
- OPC 10000-4 Part 4: Services (v1.05) — OPC Foundation
- OPC 10000-7 Part 7: Profiles (v1.05) — OPC Foundation
- OPC 10000-6 Part 6: Mappings (v1.05) — OPC Foundation
Updated 2026-10-02