]> granicus.if.org Git - icinga2/commitdiff
Handle exceptions from X092certificate2 6201/head
authorJean Flach <jean-marcel.flach@icinga.com>
Thu, 5 Apr 2018 11:36:12 +0000 (13:36 +0200)
committerJean Flach <jean-marcel.flach@icinga.com>
Thu, 5 Apr 2018 11:37:11 +0000 (13:37 +0200)
refs #6200

agent/windows-setup-agent/SetupWizard.cs

index 793772de99e26165422935cf188f63caf3e87fd4..fc903fd91788ac87a2a0cf553a93d470a0db60e4 100644 (file)
@@ -176,9 +176,12 @@ namespace Icinga
                        }
 
                        SetRetrievalStatus(100);
-
-                       X509Certificate2 cert = new X509Certificate2(_TrustedFile);
-                       Invoke((MethodInvoker)delegate { ShowCertificatePrompt(cert); });
+                       try {
+                               X509Certificate2 cert = new X509Certificate2(_TrustedFile);
+                               Invoke((MethodInvoker)delegate { ShowCertificatePrompt(cert); });
+                       } catch (Exception e) {
+                               ShowErrorText("Failed to receive certificate: " + e.Message);
+                       }
                }
 
                private void ConfigureService()