Skip to content

Commit

Permalink
Preferer a higher SecurityMode over SecurityLevel in CoreClientUtils.…
Browse files Browse the repository at this point in the history
…SelectEndpoint() (#1405)
  • Loading branch information
nschermer committed May 20, 2021
1 parent af6b2b4 commit 6d23272
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Libraries/Opc.Ua.Client/CoreClientUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ int discoverTimeout
// The security level is a relative measure assigned by the server to the
// endpoints that it returns. Clients should always pick the highest level
// unless they have a reason not too.
if (endpoint.SecurityLevel > selectedEndpoint.SecurityLevel)
// Some servers however, mess this up a bit. So prefer a higher SecurityMode
// over the SecurityLevel.
if (endpoint.SecurityMode > selectedEndpoint.SecurityMode
|| (endpoint.SecurityMode == selectedEndpoint.SecurityMode
&& endpoint.SecurityLevel > selectedEndpoint.SecurityLevel))
{
selectedEndpoint = endpoint;
}
Expand Down

0 comments on commit 6d23272

Please sign in to comment.