display tls certificate subject & serial in check_trust modal

This commit is contained in:
nworbnhoj 2023-06-24 15:02:48 +10:00
parent 0d1e89e560
commit 472e4407b8

View file

@ -110,10 +110,17 @@ pub fn check_trust(certificates: &[Certificate]) -> bool {
let chain: Vec<String> = certificates
.iter()
.map(|x509| format!("{}", &x509.tbs_certificate.issuer()))
.map(|x509| {
let subject = x509.subject();
format!(
"{}\n{}\n{}",
&subject,
&x509.raw_serial_as_string()[0..24],
&x509.raw_serial_as_string()[24..],
)
})
.collect();
let chain: Vec<&str> = chain.iter().map(AsRef::as_ref).collect();
modals
.add_list(chain)
.expect("couldn't build checkbox list");