MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / set_security_policy

Method set_security_policy

opcua/server/server.py:196–214  ·  view source on GitHub ↗

Method setting up the security policies for connections to the server, where security_policy is a list of integers. During server initialization, all endpoints are enabled: security_policy = [ ua.SecurityPolicyType.NoS

(self, security_policy)

Source from the content-addressed store, hash-verified

194 return self.iserver.get_endpoints()
195
196 def set_security_policy(self, security_policy):
197 """
198 Method setting up the security policies for connections
199 to the server, where security_policy is a list of integers.
200 During server initialization, all endpoints are enabled:
201
202 security_policy = [
203 ua.SecurityPolicyType.NoSecurity,
204 ua.SecurityPolicyType.Basic256Sha256_SignAndEncrypt,
205 ua.SecurityPolicyType.Basic256Sha256_Sign
206 ]
207
208 E.g. to limit the number of endpoints and disable no encryption:
209
210 set_security_policy([
211 ua.SecurityPolicyType.Basic256Sha256_SignAndEncrypt])
212
213 """
214 self._security_policy = security_policy
215
216 def set_security_IDs(self, policyIDs):
217 """

Calls

no outgoing calls

Tested by

no test coverage detected