From b48eb0a3c275a4cfc9e6f35167bfdbe3f6c3c635 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 28 Nov 2024 16:43:13 +0200 Subject: [PATCH] show not_valid_before date --- src/app/browser/window/tab/item/identity/gemini.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/browser/window/tab/item/identity/gemini.rs b/src/app/browser/window/tab/item/identity/gemini.rs index dacf9ce3..967cbbc5 100644 --- a/src/app/browser/window/tab/item/identity/gemini.rs +++ b/src/app/browser/window/tab/item/identity/gemini.rs @@ -10,6 +10,8 @@ use gtk::{ }; use std::rc::Rc; +const DATE_FORMAT: &str = "%Y.%m.%d"; + pub struct Gemini { // profile: Rc, widget: Rc, @@ -68,11 +70,16 @@ impl Gemini { Value::ProfileIdentityGeminiId(identity.id), &certificate.subject_name().unwrap().replace("CN=", ""), // trim prefix &format!( - "valid until {} | auth: {}", + "{} - {} | auth: {}", + certificate + .not_valid_before() + .unwrap() + .format(DATE_FORMAT) + .unwrap(), certificate .not_valid_after() .unwrap() - .format("%Y-%m-%d") + .format(DATE_FORMAT) .unwrap(), profile .identity