Closed backspacer80 closed 1 year ago
@backspacer80 If you use approach number 2 for example you could further restrict the ActivateSession service call on the server to accept connections on the port reserved for secure communication, only if the SecurityPolicy is different than SecurityPolicies.None. You have the necessary information under the local variable "OperationContext context" instance (OperationContext.ChannelContext.EndpointDescription)
@backspacer80 If you use approach number 2 for example you could further restrict the ActivateSession service call on the server to accept connections on the port reserved for secure communication, only if the SecurityPolicy is different than SecurityPolicies.None. You have the necessary information under the local variable "OperationContext context" instance (OperationContext.ChannelContext.EndpointDescription)
Thank you, that answers my question. I ended up overriding ActivateSession and setting StatusCodes.BadSecurityModeRejected as result in order to reject insecure connections.
Type of issue
Current Behavior
I have a device with an Opc Ua Server running on it. There are clients both inside the device and outside the device. I have the requirement that the clients that connect from outside are forced to use encryption (for security reasons) and clients from inside are forced to NOT use enryption (for performance reasons). First question: Is this achievable at all? I have tried different configurations to achieve that (more on that below) but still I can make a client from outside connect to the server without security. I have tried so far:
So why does the server not reject the insecure connections? Is this by design or is this a bug? Am I using the right approach or is there another approach that does fulfill the requirement of internal/insecure vs. external/secure connections?
Expected Behavior
If the exposed endpoints don't contain policies with security mode None then client connection attempts with security mode None should be rejected.
Steps To Reproduce
Here is the server config file:
Here is the client code:
Environment
Anything else?
No response