Troubleshooting
Why an OPC UA client fails on an endpoint URL mismatch
Short answer
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.
On this page
The client was never rejected over a bad certificate. It failed because the endpoint URL it put into its session request is not the string the server advertises: the client lowercased the host name and appended a slash. In the documented failure, Factory I/O's OPC UA/DA driver sent opc.tcp://laptop-j7ahfdqh:53880/ to a node-red-contrib-opcua 0.2.89 server advertising opc.tcp://LAPTOP-J7AHFDQH:53880, and the server answered Server did not return an endpointdescription that matched the one used to create the secure channel. Factory I/O v2.4.6 Preview 2 removed the transformation. This article shows how to prove which side rewrote the string, why certificate trust was the false lead, and what to conclude in each case.
What the endpoint check compares #
An OPC UA connection happens in two steps, and this error belongs to the second. First the client reads the server's endpoint list and opens a secure channel. Then it sends the session-creation request, which carries the endpoint description the client selected, including the endpointUrl it intends to use. The OPC UA specification treats the secure-channel endpoint and the session endpoint as potentially different and requires the server to advertise the URL the client should use for the session. node-opcua enforces that match on its server side, and the endpointUrl is the field that mismatches most often.
Everyday browsing hides host-name case, because the DNS resolves LAPTOP and laptop to the same machine. The endpoint match normalizes nothing: recasing the host changes the string, and an appended slash guarantees inequality, so the server rejects the session instead of silently correcting it. Three parts of the URL matter here — the opc.tcp scheme, the host, the port — and the scheme family is covered in more depth in the guide to decoding OPC UA endpoint URLs.
Prove which side fails: swap clients against the same server #
Before touching certificates or configuration, repeat the documented experiment: point several clients at the same server and record which ones connect. The matrix from the documented case:
| Client | Node-RED embedded server (node-red-contrib-opcua 0.2.89) | Standalone node-opcua sample server |
|---|---|---|
| Node-RED OpcUa-Client | connected | not tested |
| node-opcua sample client (simple_client.js) | connected | not tested |
| UAExpert | connected after one certificate trust | connected |
| ProSys OPC UA Browser | connected | connected |
| Factory I/O OPC UA/DA 2.4.5 | rejected at session creation | connected |
Read the matrix as a decision. When every client fails against one server, suspect the server or its trust store. When one client fails while four others connect to that same server, and that same client connects to a different server, the failing client's session request is the suspect. That is where this case landed; the next section proves it.
Capture both endpoint URL strings #
- Record what the server advertises, exactly: scheme case, host case, port, path, trailing slash. The documented embedded server advertised
opc.tcp://LAPTOP-J7AHFDQH:53880, built from the Windows machine name in uppercase, on port 53880. - Capture the client's session-creation request from the server side, the quickest vantage point. The documented case added a trace point to the node-opcua server's session-handling code and logged each incoming request, which shows the request header and the endpoint description the client submitted. In that trace, the working UAExpert request carried a requestHeader timeoutHint of 10000 ms.
- Put the two strings side by side and compare them character by character. A correct request repeats the advertised string exactly; a transformed request differs visibly.
Worked example — the failing request against the advertised endpoint:
| Part of the URL | Server advertised | Failing client sent | Difference |
|---|---|---|---|
| Scheme | opc.tcp:// | opc.tcp:// | none |
| Host | LAPTOP-J7AHFDQH | laptop-j7ahfdqh | 13 letters recased |
| Port | 53880 | 53880 | none |
| Tail | none | / | 1 slash appended |
The diff is 13 recased letters and 1 added character; scheme and port are untouched. The recasing is cosmetic to the DNS, but the appended slash alone makes the two strings unequal, so the rejection is correct server behavior, not a server bug. The client's developer confirmed the mechanism — the toolkit behind the driver lowercased the URI and terminated it with the slash — and Preview 2 shipped the correction; 2.4.5 had already restored the connection to the standalone sample server.
Why certificate trust was the false lead #
Certificate handling still belonged in the investigation, because UAExpert asked to trust the embedded server's certificate on first connection and connected once it was granted; that procedure is the one in troubleshooting Node-RED OPC UA when UaExpert connects. A trust problem announces itself differently, though: the client reports an untrusted or invalid certificate while the secure channel opens, and the fix lives in the certificate stores — trusting the Citect OPC UA client certificate on a B&R PLC walks through placing a client certificate in a PLC's trusted store. The endpoint-description error fires later, at session creation, on a channel that already exists. Same-looking failure, different cause: capture the two strings before replacing certificates.
Some client stacks offer a setting that skips the endpoint match on the client side. Do not use it, and do not drop the security policy to force the session open: both remove the protection this check provides. Fix the URL instead.
Fix and verify #
- Update the client. Install Factory I/O v2.4.6 Preview 2 or a later build carrying the same correction, then reconnect to the OpcUa-Server node in Node-RED.
- Verify by string, not by luck. Re-capture the session request and confirm its endpointUrl equals the advertised endpoint exactly: same case, same port, no appended slash.
- Handle what remains in order. A first-connection certificate prompt is normal; grant trust once. Any rejection after the strings match moves to the certificate and security-policy path.
- Before the server serves anything beyond the bench, apply the server-side hardening for a Node-RED OPC UA server exposing PLC tags.
The decision for each case #
- The client sends a different string than the server advertises — recased host, appended slash, or both: that is a client-side transformation. Update the client to a build that preserves the URL (Preview 2 or later in the documented case). No server-side setting was identified as a fix.
- The strings match exactly and the session is still rejected: the URL is not the fault. Move to the certificate and security-policy path — trust prompts, certificate stores, and the endpoint security policies both sides advertise.
- Every client fails against one server: suspect that server's configuration or trust store. One client fails while the others connect: suspect that client's session request, and prove it with the two-string comparison.
Questions asked
Is a host name case-sensitive in an OPC UA endpoint URL?
The DNS treats host names as case-insensitive, so laptop-j7ahfdqh and LAPTOP-J7AHFDQH resolve to the same machine. That is why the lowercasing went unnoticed at first: the connection still reached the server and the secure channel opened. The rejection happens later, when the session request's endpoint string is compared against the advertised one. Treat the whole endpoint URL as an exact string in OPC UA work.
Can the mismatch be fixed by renaming the computer or editing the advertised URL?
Renaming the host to lowercase removes only the case half of the transformation; the failing client still appended a slash, so the strings would still differ. In the documented case, no server-side setting was identified that makes the embedded server accept the rewritten URL, and the correction shipped in the client. If your stack documents an override for the advertised endpoint, validate it with the same two-string comparison before relying on it.
Do other OPC UA clients have the same lowercasing behavior?
The transformation came from the middleware inside one vendor's driver, not from the OPC UA specification. The other clients in the same test submitted the advertised URL unchanged and connected. Any client can be checked the same way: capture its session request and compare the endpoint URL it sends with the string the server advertises.
Does this endpoint mismatch affect OPC DA connections?
No. OPC DA runs over COM and DCOM rather than an opc.tcp endpoint, so there is no endpoint description for a server to compare and this rejection cannot occur. Only the UA path of the driver was affected in the documented case, and the same client connected to the standalone sample server over UA while the embedded-server rejection was in place.