diff options
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) } } |