IMD SolutionComputing LibraryShop main store

Troubleshooting

Why an OPC UA client rejects the server certificate on clock mismatch

Edge computing and IIoT Published 7 min read By IMD Solution engineering team

Short answer

When one OPC UA client connects and the edge PC's client fails while collecting the server certificate, compare the server clock and the client PC clock first: a difference of a few minutes makes certificate validity checks fail. Fix the client's time, restart it, then compare the endpoint text character-for-character with the working client.

On this page
  1. Read the two messages first
  2. Why minutes of skew reject a certificate
  3. The arithmetic on one wrong clock
  4. Fix it in this order
  5. The decision, case by case
  6. Keeping the skew out afterwards
  7. Questions asked

When one OPC UA client connects and the edge PC's client fails against the same server, check the two clocks before anything else. A skew of a few minutes between the OPC UA server and the client PC can make the client reject the server certificate during collection, because each side reads the certificate's validity window against its own clock. Set the edge PC's time from the same NTP source the server uses, restart the client, and only if the rejection survives an aligned clock compare the endpoint text and the certificate trust list. This page reads the two messages the failing client prints, works the arithmetic on an 8-minute skew, and ends with the decision for the three cases you can land in.

Read the two messages first #

The report contains three observations, and they point one way:

  • No Items in the OPC UA browser pane. The pane has no data of its own; it mirrors whatever address space the client managed to read, and the client read nothing because the secure channel never completed.
  • The error appears while the client collects the server certificate. That step belongs to secure-channel setup, before any login, browse or data transfer, so nothing downstream has run yet.
  • A second client connects from the same network. The server is running, publishing endpoints and reachable, so the fault sits between this one client and the server.

The endpoint string in the error, opt.tcp:/IP:4840, deserves its own caution. A usable OPC UA endpoint address carries the opc.tcp scheme followed by host and port, and the string shown here does not; but an error line can mangle the value through formatting or transcription, so do not retype from the error. Copy the endpoint configured on the client that works and compare scheme, address, port and security selection character-for-character. The time check below comes first because it is faster and explains the reported symptom on its own.

Why minutes of skew reject a certificate #

During secure-channel setup each side validates the other's application certificate, and the validity window — the not-before and not-after times — is compared against the local clock. The comparison is exact: there is no negotiated tolerance, and each side judges the peer's certificate by its own idea of the current time. The OPC UA Part 6 mapping specification names the tell-tale directly: a certificate whose validity start time lies in the future points at a time synchronization problem.

The mirror case fails differently. A client running ahead of the server reads a certificate that is genuinely still valid as already expired once the remaining validity is shorter than the skew; the error text changes, the clock stays the cause.

Skew also trips checks outside the certificate. One documented client implementation checks the timestamp each response carries and expects it within 5 minutes of its own clock. Engineers who maintain these servers report certificate rejections from deviations of a few minutes, which is consistent with both checks failing on one wrong clock. The dependency is not specific to OPC UA either: PLC ping works but AWS IoT Core MQTT fails when the clock is wrong is the same fault in an MQTT handshake, and the same pairing of CPU clock and certificate trust decides MQTT TLS error 8089 on an S7-1500.

The arithmetic on one wrong clock #

The numbers below are an illustrative example of the mechanism, not a measurement from your network. The server and the healthy client both follow the plant NTP source; the edge PC has lost its time source.

  • Reference time at the connection attempt: 10:07:00 UTC.
  • Edge PC clock: 09:59:00 UTC.
  • Skew: 10:07:00 - 09:59:00 = 8 min 00 s, client behind.
  • The server issued its self-signed application certificate at 10:03:00, for example at first start after the configuration change that preceded the fault. In server time it has been valid for 10:07:00 - 10:03:00 = 4 min 00 s.
  • Judged from the edge PC, that not-before time of 10:03:00 lies 10:03:00 - 09:59:00 = 4 min 00 s in the future. The certificate is not yet valid, and the client stops during certificate collection.
  • The response timestamp fails independently: the server stamps the exchange 10:07:00, which sits 8 min from the client's 09:59:00 and so outside the 5-minute window the documented client accepts.

One wrong clock produces two rejections, and the server logs nothing unusual, because in its own time every value is valid. That is why the server looks healthy to the second client at the same moment the edge PC is refused.

Fix it in this order #

  1. Measure the skew before changing anything. Read the server clock and the edge PC clock against one visible reference and subtract; check both time zone settings while you are there, because a device holding local time against a UTC partner behaves like a skew of whole hours and fails the same way.
  2. Point the edge PC at the same NTP source the server uses. Support guidance from OPC UA server vendors recommends NTP synchronization for failed connections for exactly this reason. On a Windows edge PC that is the time settings page with the Windows time service aimed at the plant NTP server; on Linux it is the NTP switch in timedatectl plus the server address in the client configuration. With no NTP infrastructure, set the client clock manually to the server's time and expect to repeat it after power cycles, because a manual setting without a source drifts.
  3. Check the clock right after every controller project download. In the report behind this pattern the connection broke immediately after a renamed project was downloaded, with the host time configuration suspected of being replaced along with it. Whether your engineering tool does that takes a minute to verify: read the edge PC clock directly after the next download and compare.
  4. Restart the client runtime. Redeploy the flow or restart Node-RED so the OPC UA client node builds a fresh secure channel under the corrected clock; the node keeps its certificate store on disk, and an already-running channel is not rebuilt mid-session.
  5. Retest at three levels. The client connects with no certificate error; the browser lists the server address space instead of No Items; the flow's sink — the InfluxDB write in this setup — receives rows with a known tag, value and current timestamp. A growing row count alone proves less than one confirmed row.
  6. If the rejection survives an aligned clock, stop treating it as time. Compare the configured endpoint character-for-character against the working client, as laid out in why an OPC UA client fails on an endpoint URL mismatch. Confirm the client's certificate store holds the server certificate as trusted, because a client set to auto-accept can still refuse a certificate that fails validation for another reason — the shape repeated in MQTT connect fails after power loss when the CA certificate is missing. On Node-RED, also confirm the flow can write its certificate store at all, a distinct failure covered in why a Node-RED deploy fails on OPC UA certificate file permissions.

One line stays fixed throughout: do not make the rejection disappear by moving the endpoint to a no-security policy. That trades a wrong clock for an unauthenticated, unencrypted channel on the plant network. The clock is the fault; fix the clock.

The decision, case by case #

  • Clocks differ and the second client works: the clock is the cause. Sync the edge PC to the shared NTP source, restart the client, and expect recovery without touching the server, the project or the flow.
  • Clocks agree and the second client still works: the difference is inside the failing client. Work item 6 on that client only — endpoint text first, then trust — and leave the server alone.
  • Clocks agree, the server's included, and every client fails: the fault is server-side, in the server certificate, its trust list or its endpoint configuration. The edge PC is a bystander; take the fix there.

Keeping the skew out afterwards #

Run the server and every edge PC from one NTP source so their clocks cannot drift apart, and spot-check the pair during rounds: read both clocks, subtract, and investigate anything beyond seconds. The same alignment carries historian timestamps, session keep-alives and event ordering, so the payoff reaches well beyond this one handshake — and a dead time source found during a round is cheaper than one found during the next project download.

Questions asked

How far apart can the clocks be before OPC UA certificate checks fail?

Treat five minutes as the working ceiling: one documented client implementation rejects a response timestamp further from its own clock than that, and engineers who run these servers report certificate rejections from deviations of a few minutes. Run the server and the edge PC from one NTP source, keep them within about a minute of each other, and you stay clear of every documented threshold.

The clock is fine but the browser still shows No Items — what next?

Then the channel is up but the client is not reading the address space you expect. Confirm the node's endpoint, security policy and namespace settings against the working client, browse the server from the working client to confirm the nodes exist under the namespace the flow expects, and remember the browser pane only mirrors what its own client node read — it never queries the server directly.

Should I correct the time on the server or on the edge PC?

On the client whose connection fails, when a second client still connects: the server has already proved its clock and its certificate against a working peer. Move the failing client to the NTP source the plant already uses. Never pull the server's clock backward to match a drifting client, because a backward jump on the server disturbs every connected session and every timestamped record at once.

Can a wrong time zone cause the same certificate rejection?

Yes. A device holding local wall-clock time while the other side works in UTC behaves like a large skew: the certificate validity window and the response timestamps fall outside what the checker accepts. Check the UTC offset, not just the displayed time, because a clock that looks right on the wall can still be hours away from the server's time.

Do the certificates need to be regenerated after the clocks are fixed?

Normally no. The certificate was never invalid; the clock reading it was. Once both sides agree on the time, reconnect once: the client re-reads the server certificate and accepts it, provided the certificate is inside its validity window and trusted in the client's store. Regenerate a certificate only when it is itself expired, or when it was issued under a wrong clock and carries a validity window that no longer makes sense.

Keep reading

  • Troubleshooting

    Why an OPC UA client fails on an endpoint URL mismatch

    An OPC UA client that lowercases the server's endpoint URL and appends a slash sends a session request that fails the endpoint match. In the documented case, Factory I/O turned opc.tcp://LAPTOP-J7AHFDQH:53880 into opc.tcp://laptop-j7ahfdqh:53880/ and the node-red-contrib-opcua 0.2.89 server rejected the session; Factory I/O v2.4.6 Preview 2 removed the transformation. Compare the two strings before replacing certificates.

    Edge computing and IIoT

  • Troubleshooting

    Troubleshoot Node-RED OPC UA When UaExpert Connects

    UaExpert connecting proves the server is up, not that Node-RED negotiates the same endpoint and certificate exchange. Set the security policy to None on an isolated network: if Node-RED then connects, the fault is certificate or encryption compatibility. The deciding evidence is the server-side log line for the same attempt, time-correlated against Node-RED's error.

    Edge computing and IIoT

  • Troubleshooting

    Why a Node-RED OPC UA server updates values only when a client reads

    The address-space variables in a node-red-contrib-opcua-server flow refresh only when something reads them, so a SCADA client that subscribes or polls sees stale data. Keep the PLC-to-set-node path unchanged and add a Node-RED flow that reads the affected server variables on a repeating timer; the SCADA display then updates at that read cadence.

    Edge computing and IIoT

Validate Historian Client 2017 against a 2023 R2 SP1 server