re-implement Sigchat.probe_host() using Tls.accessible()

now the user is only presented with the tls trust_modal when none of the required CA's are trusted
This commit is contained in:
nworbnhoj 2023-12-22 14:29:06 +11:00
parent 5703707cca
commit 5e1c6f6276

View file

@ -177,26 +177,15 @@ impl<'a> SigChat<'a> {
.set_status_text(t!("sigchat.status.probing", locales::LANG)); .set_status_text(t!("sigchat.status.probing", locales::LANG));
self.chat.set_busy_state(true); self.chat.set_busy_state(true);
let tls = Tls::new(); let tls = Tls::new();
match tls.probe(host) { if tls.accessible(host, true) {
Ok(certs) => { self.chat.set_busy_state(false);
if certs.len() == 0 { true
self.modals } else {
.show_notification(t!("sigchat.account.abort", locales::LANG), None) self.modals
.expect("abort failed"); .show_notification(t!("sigchat.account.abort", locales::LANG), None)
self.chat.set_busy_state(false); .expect("abort failed");
false self.chat.set_busy_state(false);
} else { false
self.chat.set_busy_state(false);
true
}
}
Err(e) => {
self.chat.set_busy_state(false);
self.modals
.show_notification(&format!("{}", e), None)
.expect("qrcode failed");
false
}
} }
} }