summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-12-22 19:58:02 +0100
committerCarl Hetherington <cth@carlh.net>2020-12-22 19:58:02 +0100
commit79ff3ff3929470bcdcf9f36474d393ff9f7b22ed (patch)
tree0cc81e70d4237424fc9698eb3c1daa2e4479f945 /src
parentddcd4f3ba0af3e9d49dbb68127317cd0d871a248 (diff)
Fix Christie certificate download when first try fails.
Diffstat (limited to 'src')
-rw-r--r--src/wx/christie_certificate_panel.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/wx/christie_certificate_panel.cc b/src/wx/christie_certificate_panel.cc
index c4584ed3c..ab131e015 100644
--- a/src/wx/christie_certificate_panel.cc
+++ b/src/wx/christie_certificate_panel.cc
@@ -62,6 +62,7 @@ ChristieCertificatePanel::do_download ()
string const url = String::compose ("%1F-IMB/F-IMB_%2_sha256.pem", prefix, serial);
optional<string> all_errors;
+ bool ok = true;
optional<string> error = get_from_url (url, true, false, boost::bind(&DownloadCertificatePanel::load_certificate_from_chain, this, _1));
if (error) {
@@ -72,15 +73,16 @@ ChristieCertificatePanel::do_download ()
error = get_from_url (url, true, false, boost::bind(&DownloadCertificatePanel::load_certificate_from_chain, this, _1));
if (error) {
*all_errors += "\n" + *error;
+ ok = false;
}
}
- if (all_errors) {
- _dialog->message()->SetLabel(wxT(""));
- error_dialog (this, std_to_wx(*all_errors));
- } else {
+ if (ok) {
_dialog->message()->SetLabel (_("Certificate downloaded"));
_dialog->setup_sensitivity ();
+ } else {
+ _dialog->message()->SetLabel(wxT(""));
+ error_dialog (this, std_to_wx(*all_errors));
}
}