07/18/2016
Hello,
I'm working on an OPC UA client and would like to use the FindServersOnNetwork feature of the LDS-ME server. By now my client is able to get the registered OPC UA server over the FindServers method, however when I invoke the FindServersOnNetwork method I get a StatusException 'Socket was closed gracefully' and InnerStatus 'BadSecureChannelClosed'. I think the reason for that is that I haven't implement a certificate creation feature to my client yet. Since you get the Discovery Endpoints from the LDS-ME which can be configured to use certificate authentication by themself I do not understand why this is the default configuration of the LDS-ME. I found on 'http://opcfoundation-onlineapplications.org/ProfileReporting/index.htm?ModifyProfile.aspx?ProfileID=61dff98c-25d8-48a0-93e8-bbb429b3a3ab' that there is a ServerSecurityPolicy specified for connecting without authentication but it is not implemented in the 'Opc.Ua.DiscoveryServer.Config.xml' after a standard installation of the LDS-ME. So I added the following ServerSecurityPolicy but when I'm trying to connect with the 'OPC Foundation Sample Client' to 'opc.tcp://localhost:4840' the added ServerSecurityPolicy is not visible. Here the added ServerSecurityPolicy:
<ServerSecurityPolicy>
<SecurityMode>None</SecurityMode>
<SecurityPolicyUri>https://opcfoundation.org/UA/S.....ri>
<SecurityLevel>0</SecurityLevel>
</ServerSecurityPolicy>
...
</SecurityPolicies>
I also noticed that the LDS-ME is not reacting to changes to the BaseAddresses. If I change the port from 4840 to 4842 for example the LDS-ME is still listening to port 4840 although I restarted the LDS-ME service in the Services window.
<ua:String>opc.tcp://localhost:4842/UADiscovery</ua:String>
<ua:String>https://localhost:4843/UADisco.....ng>
<ua:String>http://localhost:52601/UADisco.....ng>
</BaseAddresses>
Is there another config file or why is the LDS-ME not reacting to the Opc.Ua.DiscoveryServer.Config.xml? Is it possible to use a 'None' SecurityMode somehow?
In the documentation of the LDS-ME (file:///C:/Program%20Files%20%28x86%29/Common%20Files/OPC%20Foundation/UA/Discovery/doc/index.htm) it is specified to use the 'C:\ProgramData\OPC Foundation\UA\Discovery\pki' folder however in the 'OPC Foundation Configuration Tool' the folder '%CommonApplicationData%\OPC Foundation\CertificateStores\UA Certificate Authorities' is going to be used.
Why are there to different folders and which of them should be used?
For my client implementation I'm using the 'Unified Automation SDK .NET 2.5.0.378' with '.Net 4.6.1' as target system on a Windows 7 x64 machine with Visual Studio Professional 2013.
The following code snippet shows the working FindServers invocation where no authentication is needed and where the registered OPC UA server is showing up and the FindServersOnNetwork invocation where the described exception appears:
string discoveryUrl = "opc.tcp://" + "localhost" + ":4840" +"/UADiscovery";
List serversOnPc = discovery.FindServers(discoveryUrl);
foreach (ApplicationDescription a in serversOnPc)
{
Console.WriteLine(a.ApplicationName.ToString(), Environment.NewLine);
}
List serversOnNetwork = discovery.FindServersOnNetwork(discoveryUrl);
foreach (ServerOnNetwork a in serversOnNetwork)
{
Console.WriteLine(a.ServerName.ToString(), Environment.NewLine);
}
Cheers 🙂
02/24/2014
Hello, it is possible that I have encountered the same issue and posted it here (https://opcfoundation.org/foru.....yrejected/ ), before finding your post.
May I ask, have you found some solution ?
Regards
1 Guest(s)