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));
self.chat.set_busy_state(true);
let tls = Tls::new();
match tls.probe(host) {
Ok(certs) => {
if certs.len() == 0 {
self.modals
.show_notification(t!("sigchat.account.abort", locales::LANG), None)
.expect("abort failed");
self.chat.set_busy_state(false);
false
} else {
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
}
if tls.accessible(host, true) {
self.chat.set_busy_state(false);
true
} else {
self.modals
.show_notification(t!("sigchat.account.abort", locales::LANG), None)
.expect("abort failed");
self.chat.set_busy_state(false);
false
}
}