From 09d7bf9050fe10bc317fe12e5c27b9eee445dc82 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Tue, 28 Apr 2020 14:04:34 +0200 Subject: [PATCH] Fixes missing port argument for save-cert Icinga 2 command Fixes #63 --- .../installer/Install-IcingaAgentCertificates.psm1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/core/icingaagent/installer/Install-IcingaAgentCertificates.psm1 b/lib/core/icingaagent/installer/Install-IcingaAgentCertificates.psm1 index 71699de..5a13f55 100644 --- a/lib/core/icingaagent/installer/Install-IcingaAgentCertificates.psm1 +++ b/lib/core/icingaagent/installer/Install-IcingaAgentCertificates.psm1 @@ -50,15 +50,17 @@ function Install-IcingaAgentCertificates() # Argument --key for save-cert is deprecated starting with Icinga 2.12.0 if (Compare-IcingaVersions -RequiredVersion '2.12.0') { - $arguments = [string]::Format('pki save-cert --trustedcert {0}trusted-parent.crt --host {1}', + $arguments = [string]::Format('pki save-cert --trustedcert {0}trusted-parent.crt --host {1} --port {2}', $CertificateDirectory, - $Endpoint + $Endpoint, + $Port ); } else { - $arguments = [string]::Format('pki save-cert --key {0}{1}.key --trustedcert {0}trusted-parent.crt --host {2}', + $arguments = [string]::Format('pki save-cert --key {0}{1}.key --trustedcert {0}trusted-parent.crt --host {2} --port {3}', $CertificateDirectory, $Hostname, - $Endpoint + $Endpoint, + $Port ); }