Merge pull request #6201 from Icinga/fix/x509-exception

Handle exceptions from X509Certificate2
This commit is contained in:
Jean Flach 2018-04-06 10:56:27 +02:00 committed by GitHub
commit 90d39d7d7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

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