diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-05 17:45:21 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-05 17:52:27 +0100 |
commit | 43a0fe14b2ae6a3e97f39169cda7ca5579a3259c (patch) | |
tree | 30589d3e2b8b5e55520af303304c5bef6c4b5cf2 /src/cert.rs | |
parent | d523c27ae4b3d86eb67fcf85af23ad223fd09b6c (diff) | |
download | tricot-43a0fe14b2ae6a3e97f39169cda7ca5579a3259c.tar.gz tricot-43a0fe14b2ae6a3e97f39169cda7ca5579a3259c.zip |
Update dependencies
Diffstat (limited to 'src/cert.rs')
-rw-r--r-- | src/cert.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cert.rs b/src/cert.rs index 12b9218..3f08632 100644 --- a/src/cert.rs +++ b/src/cert.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use anyhow::Result; -use chrono::{Date, NaiveDate, Utc}; +use chrono::{NaiveDate, Utc}; use rustls::sign::CertifiedKey; use serde::{Deserialize, Serialize}; @@ -54,8 +54,7 @@ impl Cert { } pub fn is_old(&self) -> bool { - let date = Date::<Utc>::from_utc(self.ser.date, Utc); - let today = Utc::today(); - today - date > chrono::Duration::days(self.ser.valid_days / 2) + let today = Utc::now().date_naive(); + today - self.ser.date > chrono::Duration::days(self.ser.valid_days / 2) } } |