From 2858154ed5ebe894ba0e86fb51bc546b116fdb87 Mon Sep 17 00:00:00 2001 From: Sindri Frostason Date: Sun, 10 Jul 2022 19:27:27 +0000 Subject: [PATCH] Use DateTime for token creation time (#217) SecureChannel.token_created_at was set using the OPC server time which could cause connection failures if the OPC server is not configured correctly. Changed so that the same time source is used to determine the token lifetime (DateTime::now()) Co-authored-by: Sindri Frostason --- lib/src/core/comms/secure_channel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/core/comms/secure_channel.rs b/lib/src/core/comms/secure_channel.rs index 9709b217e..e3a97438e 100644 --- a/lib/src/core/comms/secure_channel.rs +++ b/lib/src/core/comms/secure_channel.rs @@ -176,7 +176,7 @@ impl SecureChannel { pub fn set_security_token(&mut self, channel_token: ChannelSecurityToken) { self.secure_channel_id = channel_token.channel_id; self.token_id = channel_token.token_id; - self.token_created_at = channel_token.created_at; + self.token_created_at = DateTime::now(); self.token_lifetime = channel_token.revised_lifetime; }