Skip to content

Commit

Permalink
Use DateTime for token creation time (locka99#217)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Jarngreipr and Sindri Frostason authored Jul 10, 2022
1 parent a45529a commit 2858154
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/core/comms/secure_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2858154

Please sign in to comment.