Connect fails with OPC Foundation DataAccess Client

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
fpethig
Hero Member
Hero Member
Posts: 37
Joined: 30 Sep 2013, 08:19

Connect fails with OPC Foundation DataAccess Client

Post by fpethig »

Hello everybody,
I'm having trouble connecting to the unified automation cpp server with the Quickstart DataAccess Client provided by the OPC Foundation. I'm using the following setup:

- OPC UA Server setup using the Unified Automation C++ SDK running inside a virtual machine (Oracle VirtualBox, Ubuntu Linux)
- OPC UA Expert running on Ubuntu Linux inside the virtual machine
- OPC UA Expert running on the Windows 7 Host machine
- OPC UA Quickstart DataAccess Client from the OPC Foundation running also on the Windows 7 Host Machine

The UA Expert inside the VM as well as the UA Expert on the host machine can connect to the server without problems. Nevertheless when I try to connect using the OPC foundation client I get an Exception (please see attachment for details). Since the Exception "BadCertificateHostNameInvalid" let's suspect that something is wrong with either the hostname or some certificate I already tried the following steps unsuccessfully:

-Looked for rejected certificates on the server side and client side. None found.
-Changed the [NodeName] wildcard configuration inside the ServerConfiguration.xml to the current IP-Address of the VirtualMachine. Still the same Exception.

I would be glad if you could help me with this issue.

Regards
Florian

fpethig
Hero Member
Hero Member
Posts: 37
Joined: 30 Sep 2013, 08:19

Re: Connect fails with OPC Foundation DataAccess Client

Post by fpethig »

Could you please give some feedback regarding this?
We are currently evaluating different OPCUA SDKs and support quality is also an issue..

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: Connect fails with OPC Foundation DataAccess Client

Post by Support Team »

As you may have noticed we do not support the .NET Code from the OPC Foundation, this is just sample code which is not recommended for serious development. This code might have errors, and because UaExpert can connect without problems, it is quite obvious that the error is in the OPC Foundation sample code.

We have written our own .NET SDK for a reason. We called it .NET SDK V2.x.x to clearly state the fact that it is different from the OPC Foundation samples. For our commercially available SDK we provide support.

Anyway, as the error is pretty clearly stated in the exception, this looks like a typical problem in a network where you don't have a proper DNS (Domain Name Server) installed and running. The name resolution is different on Windows and on Linux machines, without a having DNS you could extend the etc/host file. It seems that the Windows machine can not resolve the name of the Linux. My guess is that the OPC Foundation code is validating the hostname in the certificate against the IP used for connecting, this will always fail.

You should either debug through the OPC Foundation code and "bypass" that paranoid validation, or you could setup proper name resolution within you network.

Best Regards
Support Team

fpethig
Hero Member
Hero Member
Posts: 37
Joined: 30 Sep 2013, 08:19

Re: Connect fails with OPC Foundation DataAccess Client

Post by fpethig »

Thank you, just changing the host file already helped.

Post Reply