Replies: 1 comment
-
|
Take a look at a Wireshark capture and I think you’ll find that it’s the server returning these endpoint URLs in the EndpointDescriptions, not the client modifying them. Modifying/replacing the EndpointDescription is the standard solution when a server has misconfigured endpoints or endpoint URLs with hostnames that otherwise don’t match the one your client is using. It’s what every OPC UA client out there does when it warns you about the hostname not matching the one you used for discovery (e.g. UaExpert). You can make it a little less cumbersome by using one of the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have encountered an issue with the way the library handles endpoint URLs when using
DiscoveryClient.getEndpoints(). Specifically, even when I pass an endpoint URL in the following format:The library retrieves endpoints with this structure instead:
As a result, if the server relies on fully qualified domain names (FQDNs), such as
<srvname>.example.com, the mismatch causes ajava.net.UnknownHostException. This happens because the library seems to drop the domain component (e.g.,.example.com) from the provided endpoint URL.This behavior introduces issues in environments where multiple servers or services with similar hostnames (but different domains) are used, and explicit domain resolution is required.
Steps to reproduce:
opc.tcp://<srvname>.example.com:<port>/.DiscoveryClient.getEndpoints(endpointUrl).opc.tcp://<srvname>:<port>/.Expected behavior: The discovered endpoints should retain the full structure of the provided
endpointUrl, including the domain (e.g.,.example.com), for accurate host resolution.Temporary workaround: To mitigate the issue, I am manually replacing the endpoint URL in the returned
EndpointDescriptionobject, as follows:While this workaround allows me to proceed, it is not ideal since it relies on manually constructing a new
EndpointDescriptionobject each time. This approach adds unnecessary complexity to the code and feels cumbersome for something that should be handled directly by the library.I kindly ask for clarification about this behavior or guidance on any better way to ensure that the domain is preserved in the discovered endpoints.
Thank you in advance for your support!
Best regards
Beta Was this translation helpful? Give feedback.
All reactions