From 0aa1d57745df0119b16224d959a110b503eb0305 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Tue, 24 Nov 2020 13:52:37 +0100 Subject: [PATCH] Fix Agent certificate fetching for REST-Api --- doc/31-Changelog.md | 1 + .../icingaagent/getters/Get-IcingaAgentHostCertificate.psm1 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/31-Changelog.md b/doc/31-Changelog.md index b0cc88e..8c1a18c 100644 --- a/doc/31-Changelog.md +++ b/doc/31-Changelog.md @@ -41,6 +41,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic * [#143](https://github.com/Icinga/icinga-powershell-framework/issues/143) Fixes the annoying hint from the analyzer to check space before open brace * [#152](https://github.com/Icinga/icinga-powershell-framework/issues/152) Fixes incorrect rendering for empty arrays which used `$null` incorrectly instead of `@()` and fixed ValidateSet which now also supports arrays as data type * [#159](https://github.com/Icinga/icinga-powershell-framework/pull/159) Fixes crash during update of the Icinga Framework, caused by the newly introduced experimental feature for code caching +* [#165](https://github.com/Icinga/icinga-powershell-framework/pull/165) Fixes fetching for Icinga Agent certificate for REST-Api daemon on upper/lower case hostname mismatch ## 1.2.0 (2020-08-28) diff --git a/lib/core/icingaagent/getters/Get-IcingaAgentHostCertificate.psm1 b/lib/core/icingaagent/getters/Get-IcingaAgentHostCertificate.psm1 index 8b86893..027461d 100644 --- a/lib/core/icingaagent/getters/Get-IcingaAgentHostCertificate.psm1 +++ b/lib/core/icingaagent/getters/Get-IcingaAgentHostCertificate.psm1 @@ -7,7 +7,7 @@ function Get-IcingaAgentHostCertificate() $CertPath = $null; foreach ($certFile in $FolderContent) { - if ($certFile.Name.Contains($Hostname)) { + if ($certFile.Name -like ([string]::Format('{0}.crt', $Hostname))) { $CertPath = $certFile.FullName; break; }