From e470e8927a19708af78bb7cbbbef66a635ecdcc6 Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Thu, 5 Apr 2018 13:36:12 +0200 Subject: [PATCH] Handle exceptions from X092certificate2 refs #6200 --- agent/windows-setup-agent/SetupWizard.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/agent/windows-setup-agent/SetupWizard.cs b/agent/windows-setup-agent/SetupWizard.cs index 793772de9..fc903fd91 100644 --- a/agent/windows-setup-agent/SetupWizard.cs +++ b/agent/windows-setup-agent/SetupWizard.cs @@ -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()