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

Method open_secure_channel

opcua/server/uaprocessor.py:51–64  ·  view source on GitHub ↗
(self, algohdr, seqhdr, body)

Source from the content-addressed store, hash-verified

49 self.socket.write(data)
50
51 def open_secure_channel(self, algohdr, seqhdr, body):
52 request = struct_from_binary(ua.OpenSecureChannelRequest, body)
53
54 if not self._connection.is_open():
55 # Only call select_policy if the channel isn't open. Otherwise
56 # it will break the Secure channel renewal.
57 self._connection.select_policy(
58 algohdr.SecurityPolicyURI, algohdr.SenderCertificate, request.Parameters.SecurityMode)
59
60 channel = self._connection.open(request.Parameters, self.iserver)
61 # send response
62 response = ua.OpenSecureChannelResponse()
63 response.Parameters = channel
64 self.send_response(request.RequestHeader.RequestHandle, seqhdr, response, ua.MessageType.SecureOpen)
65
66 def forward_publish_response(self, result):
67 self.logger.info("forward publish response %s", result)

Callers 1

processMethod · 0.95

Calls 5

send_responseMethod · 0.95
struct_from_binaryFunction · 0.90
is_openMethod · 0.80
select_policyMethod · 0.80
openMethod · 0.80

Tested by

no test coverage detected