← Articles
OPC UA/9 min read/— views

OPC UA Certificate Renewal: Ten Checks, and the One That Proves Clients Still Validate

Renewing an OPC UA certificate: the UTC trap in notAfter, reading SAN and key length with openssl, UpdateCertificate and ApplyChanges from IEC 62541-12, and ten pass criteria run with forced values.

OPC UASCADAHistorianNetworkingChecklistsTroubleshooting

The certificate said it expired on 14 October. So the work was booked for 22:00 on the 14th. Communications dropped at 15:00 that afternoon.

An X.509 notAfter is not in your local time. RFC 5280 §4.1.2.5.1 requires UTCTime values to be expressed in GMT (Zulu) and to include seconds. A certificate reading notAfter=Oct 14 06:02:48 2031 GMT dies at 06:02:48 UTC — which is 15:02:48 in Seoul, 08:02 in Berlin during summer time. Nine hours of offset is enough to destroy a night-shift plan.

The path a new certificate takes from CSR to each client trust list, and the validation StatusCode each stage returns when it is wrong WHERE THE NEW CERTIFICATE HAS TO LAND CSRcreated CA signssha256 serverown/certs ApplyChangessessions drop N clientstrusted/certs past notAfter not in trust list no CRL Bad_CertificateTimeInvalid Bad_CertificateUntrusted Bad_CertificateRevocationUnknown IEC 62541-4 certificate validation

Start with the fact that there are two stores

Treat renewal as one step and you finish half of it. An OPC UA application holds certificates in two distinct roles.

  • Its own certificate — the application instance certificate, usually own/certs plus own/private. This is how it proves who it is. A private key comes with it.
  • Its trust list — trusted/certs, trusted/crl, issuers/certs. This is the basis on which it believes someone else. No private key.

Replacing the server's own certificate is work on one machine. Everything that has to believe that certificate is every client: HMIs, historian collectors, edge gateways, the report server, the engineering laptop. The trust list exists once per client. That is almost always why three clients stay down on renewal day, and the server log is clean while it happens.

With self-signed certificates this job is N separate jobs. Issue from a CA instead, with clients holding the CA certificate in issuers/certs, and renewing the server certificate touches no client at all. Past five or so devices, standing up a CA is the cheaper option. One small plant-internal CA is enough.

Read the certificate before you install it

Vendor UIs tend to finish this with a single "generate certificate" button, and nobody ever looks at what the button produced. Just read the DER file.

openssl x509 -in own/certs/MyServer.der -inform der -noout -dates -ext subjectAltName
openssl x509 -in own/certs/MyServer.der -inform der -noout -text \
  | grep -E "Public-Key|Signature Algorithm"

Real output looks like this:

notBefore=Oct 15 06:02:48 2026 GMT
notAfter=Oct 14 06:02:48 2031 GMT
X509v3 Subject Alternative Name:
    URI:urn:plc-gateway-01:Vendor:UaServer, DNS:plc-gateway-01, IP Address:10.20.30.40
        Signature Algorithm: sha256WithRSAEncryption
                Public-Key: (2048 bit)

Four things to check in those lines.

  1. Convert notAfter to local time. The certificate above ends at 15:02:48 KST on 2031-10-14. Book the outage window before that, not before midnight on the date printed in the UI.
  2. Whether the URI: entry matches the server's applicationUri character for character. IEC 62541-6 requires the ApplicationUri to appear as a uniformResourceIdentifier entry in the SubjectAltName. One character off is Bad_CertificateUriInvalid. Cloning a VM and changing only the hostname lands here. The symptoms are separated out in why OPC UA rejects a server you can ping.
  3. Whether every name clients actually dial is present as DNS: or IP Address:. If some clients connect by DNS and others by IP, both have to be in there; the missing one gets Bad_CertificateHostNameInvalid. Behind NAT, include the externally reachable name too.
  4. Key length and signature algorithm. The SHA-256 security policies use RSA keys of 2048 to 4096 bits. A certificate signed sha1WithRSAEncryption is not a renewal candidate — it is a retirement candidate.

Renewal is the cheap moment to raise the policy

Basic128Rsa15 and Basic256 rest on SHA-1 and were deprecated in OPC UA 1.04. What is current is Basic256Sha256, Aes128_Sha256_RsaOaep, and Aes256_Sha256_RsaPss (IEC 62541-7, Profiles). The day you are already reissuing the certificate is the cheapest day to move the policy. Do it separately later and you pay for the same outage twice.

Check MessageSecurityMode in the same pass. Drop it to None while troubleshooting, forget to put it back, and nothing happens when the certificate later expires: the link stays up and the security is gone. The quiet failure is the worse one. Policy-by-policy symptoms are in connects with None, fails with Basic256Sha256.

If the server supports the push model, do not touch files

IEC 62541-12 defines certificate management as OPC UA services. The methods live under the ServerConfiguration object in the server's address space.

MethodWhat it does
CreateSigningRequestThe server produces the CSR. The private key never leaves the device.
UpdateCertificatePushes the signed certificate in. Returns applyChangesRequired.
ApplyChangesActually applies the new certificate. Secure channels drop.
GetRejectedListThe certificates the server refused.

Two things here matter more than the rest.

When UpdateCertificate returns applyChangesRequired as true, nothing is live until you call ApplyChanges — and ApplyChanges is what closes the sessions. So the outage is a single method call, not a service restart, and you choose its timestamp. The hole in the historian trend is measured against that timestamp. It is also the time to write in the work record.

GetRejectedList is the most useful call you make all day. It hands back the client certificates the server refused, so finding out which client failed does not mean reading logs on ten machines. After every production client has reconnected, that list should be empty.

The certificate groups are easy to miss. DefaultApplicationGroup, DefaultHttpsGroup, DefaultUserTokenGroup. Renew the application group alone and the other two keep walking toward their own expiry dates.

Nobody ever closes out the revocation list

If the reason for renewal is a leaked key, installing the new certificate is not the end of the job. The old one has to stop working. That is what a CRL is for, and the trusted/crl slot in the trust list is where it goes.

The trouble is the behaviour when it is absent. With no CRL available for the issuer, the validation outcome is Bad_CertificateRevocationUnknown — and a lot of stacks ship configured to ignore exactly that. The revoked certificate then connects normally. Believing you revoked something is the dangerous state.

Self-signed certificates have no CRL at all. Revocation means deleting the certificate from every peer's trust list, by hand, N times. The answer is a CA here too.

Ten pass criteria

A green icon is not evidence. These are run by forcing values wrong. Numbers 4 and 5 are the ones that matter — everything else checks whether it works, and those two check whether anything is actually validating.

  1. Read notAfter with openssl x509 -noout -dates and convert it to local time. Record the days remaining.
  2. Compare the SAN URI: entry to the server's applicationUri character by character. Looking similar is not being equal.
  3. Connect using every name any client uses: DNS, IP, external NAT name. One at a time, all of them.
  4. On a bench, move a client clock past notAfter. You should get Bad_CertificateTimeInvalid. If it connects anyway, that client is not checking the validity period at all.
  5. Delete the new server certificate from one client's trust list and connect. You should get Bad_CertificateUntrusted. If it connects, that client is auto-trusting and the link is not secured. Engineering tools are the usual offender. Put the certificate back afterwards.
  6. GetRejectedList comes back empty — checked after every production client has reconnected, not before.
  7. MessageSecurityMode reads SignAndEncrypt on each session. No session quietly fell back to None.
  8. securityRejectedSessionCount in ServerDiagnosticsSummary has stopped rising (IEC 62541-5). If it climbs, a client still has not got in.
  9. The gap in the historian trend is explained by the ApplyChanges timestamp. Longer than that means a collector never reconnected.
  10. The old certificate is on a CRL that every peer genuinely holds, or it is deleted from every trust list. "We revoked it" on its own is not a result.

On a redundant pair, renew the standby first, fail over, run 1 through 9 again, then do the other side. That is also when to confirm the two nodes have different applicationUri values — the trap is written up in testing OPC UA redundant failover.

The next thing to check

When the renewal is done, four lines go in the project folder: subject and thumbprint, the applicationUri, notAfter in both UTC and local time, and the moment you called ApplyChanges.

One thing is still open after that. Restore an old VM snapshot during a recovery drill and the expired certificate comes back with it. How certificates sit inside the backup set is covered in restoring on a clean machine, and the service accounts tangled up with them are in rotating service account passwords. The habit of writing down the values the server corrected for you is in the client commissioning checklist.