From 5e1c6f627695d9d6bc49494e63a187fd5a9c7ac9 Mon Sep 17 00:00:00 2001 From: nworbnhoj Date: Fri, 22 Dec 2023 14:29:06 +1100 Subject: [PATCH] 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 --- apps/sigchat/src/lib.rs | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/apps/sigchat/src/lib.rs b/apps/sigchat/src/lib.rs index 03f8d1160..ad7c6b37d 100644 --- a/apps/sigchat/src/lib.rs +++ b/apps/sigchat/src/lib.rs @@ -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 } }