Preferer a higher SecurityMode over SecurityLevel in CoreClientUtils.… #1405
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…SelectEndpoint()
Normally a server should give a higher SecurityLevel when SignAndEncrypt is used, but often this is messed up. The sample client preferes SignAndEncrypt over the SecurityLevel, so it seems to make sense to do the same in this function.
The Siemens server I tested returns the following list:
Where securityLevel is 1, 2, 3, 4 in this list. So when selecting by only the SecurityLevel, the last item is used (Sign - Basic256).
Kepware does this a bit better and gives the highest level score to SignAndEncrypt.
Reference server gives SignAndEncrypt a +100 score.