From a23e855b660fc4a85f553802b2b89baf142c4849 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 15 Nov 2025 20:05:59 -0600 Subject: [PATCH] Update vCenter-SSL.ps1 --- inc/vCenter-SSL.ps1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/inc/vCenter-SSL.ps1 b/inc/vCenter-SSL.ps1 index 5569c1ac..ab0deee5 100644 --- a/inc/vCenter-SSL.ps1 +++ b/inc/vCenter-SSL.ps1 @@ -1,6 +1,6 @@ #!/usr/bin/env pwsh # ----------------------------------------------------------------------------------- -# vCenter + Posh-ACME Script using PowerCLI (Final Corrected) +# vCenter + Posh-ACME Script using PowerCLI (Final Working Version) # ----------------------------------------------------------------------------------- . /opt/idssys/nodemgmt/conf/powerwall/settings.ps1 @@ -92,7 +92,7 @@ $certName = "vcenter-cert" $certSuccess = $false try { Write-Host "Requesting certificate via Posh-ACME..." -ForegroundColor Cyan - New-PACertificate -Domain $VCENTERHOST -DnsPlugin PowerDNS -PluginArgs $pArgs -Contact $ACMEEMAIL -AcceptTOS -Verbose -Force + New-PACertificate -Domain $VCENTERHOST -DnsPlugin PowerDNS -DnsSleep 15 -PluginArgs $pArgs -Contact $ACMEEMAIL -AcceptTOS -Verbose -Force $certSuccess = $true } catch { Write-Host "ACME certificate request failed: $($_.Exception.Message)" -ForegroundColor Yellow @@ -100,11 +100,12 @@ try { } # ---------------------------- -# Collect certificate paths +# Collect certificate paths dynamically # ---------------------------- if ($certSuccess) { - $paAccount = Get-PAAccount - $certFolder = $paAccount.CertFolder + # Get the folder for this specific domain + $certFolder = (Get-PAOrder -Domain $VCENTERHOST).CertFolder + $certPath = Join-Path $certFolder "$certName\cert.pem" $keyPath = Join-Path $certFolder "$certName\privkey.pem" $chainPath = Join-Path $certFolder "$certName\chain.pem"