OPC UA security & certificates
Security is built into OPC UA, not bolted on. A connection negotiates a security policy and mode, then client and server authenticate each other with X.509 certificates. Understanding these two ideas (modes and trust) resolves most security questions and connection failures.
The four pillars
| Pillar | What it protects |
|---|---|
| Encryption | Confidentiality: nobody can read the traffic |
| Signing | Integrity: messages can't be tampered with |
| Authentication | Identity, of the application (certificate) and user |
| Authorisation | Permissions: what an authenticated user may do |
Security modes
- None, no signing/encryption. Only for isolated testing.
- Sign: messages are signed (integrity + auth) but not encrypted.
- Sign & Encrypt: signed and encrypted. Use this in production.
Each mode pairs with a security policy (the cipher suite, e.g. Basic256Sha256 or the newer Aes256 policies). Prefer modern policies and disable deprecated ones.
Which OPC UA security policy should you use?
Use the newest policy that both client and server offer, with SignAndEncrypt. In practice that means Aes256_Sha256_RsaPss or Aes128_Sha256_RsaOaep where available, Basic256Sha256 where they are not, and never the deprecated SHA-1 policies. Check the list in the server's endpoint configuration, then disable what you do not use.
| Policy (name as most stacks show it) | Status | Use it? |
|---|---|---|
None | No signing or encryption | Isolated testing only |
Basic128Rsa15 | Deprecated (SHA-1) | No: disable |
Basic256 | Deprecated (SHA-1) | No: disable |
Basic256Sha256 | Current, widely supported | Yes, where the newer policies are not offered |
Aes128_Sha256_RsaOaep | Current, newer RSA policy | Yes, preferred when both sides support it |
Aes256_Sha256_RsaPss | Current, newer RSA policy | Yes, preferred when both sides support it |
How certificate trust works
Every OPC UA application has its own instance certificate. On connect, client and server exchange certificates; each keeps a small PKI store:
pki/
├─ own/ # this application's own cert + private key
├─ trusted/certs # certificates we trust
├─ trusted/crl # certificate revocation lists
├─ issuer/ # CA certs (if using a CA)
└─ rejected/ # certs seen but not yet trusted
rejected/. Move it to trusted/certs on both ends, then reconnect. This single step fixes most "BadSecurityChecksFailed" errors.Self-signed vs CA-signed
Self-signed certificates are fine for small, static deployments: you manually trust each one. For fleets, a Certificate Authority (or the OPC UA GDS: Global Discovery Server) scales trust: trust the CA once and every certificate it issues is trusted automatically.
User authentication
Application (certificate) identity is separate from user identity. A server can accept anonymous, username/password, or user certificate tokens. Match what the server expects, and prefer named users over anonymous in production so actions are attributable.
Hardening checklist
- Use Sign & Encrypt with a modern policy; disable None and deprecated policies.
- Replace default/self-signed certs with managed ones; set sensible expiry and rotate.
- Require named users; disable anonymous where possible.
- Apply least-privilege authorisation: read-only unless write is truly needed.
- Keep CRLs current; remove stale certs from
trusted/. - Put OPC UA on a segmented network; restrict the port to known clients.
- Patch your OPC UA stack: treat it like any other networked service.
Questions engineers ask
Why is my OPC UA certificate rejected?
The receiving side has not trusted it yet: it sits in the rejected folder until someone moves it to the trusted folder. If you use a CA, the CA certificate must be in the issuer store with a current revocation list. The ApplicationUri and host name in the certificate must also match the application and the address you dial.
What happens when an OPC UA certificate expires?
The peer rejects it with BadCertificateTimeInvalid and the connection fails, often without warning on a running line. Track expiry dates, renew before they pass, and check the clocks on both machines: a wrong clock gives the same error.
Should I use self-signed or CA-signed certificates?
Self-signed certificates suit a few static connections, because you trust each one by hand. For many machines, a certificate authority or a Global Discovery Server scales better: trust the issuer once and every certificate it signs is accepted.
Is OPC UA security enough on its own for an OT network?
It covers the connection: authentication, integrity and encryption. It does not replace network segmentation, least-privilege user roles and patching of the OPC UA stack. Treat it as one layer of plant security, not the whole of it.
Matching status codes: BadSecurityPolicyRejected, BadCertificateUntrusted, BadCertificateTimeInvalid, BadCertificateUriInvalid, BadCertificateHostNameInvalid, BadSecurityChecksFailed.
Last updated 1 December 2026 · Educational resource.