Update vCenter-SSL.ps1
This commit is contained in:
@@ -65,7 +65,7 @@ try {
|
|||||||
Install-Module VCF.PowerCLI -Force -Scope AllUsers -AllowClobber
|
Install-Module VCF.PowerCLI -Force -Scope AllUsers -AllowClobber
|
||||||
}
|
}
|
||||||
|
|
||||||
Import-Module VCF.PowerCLI -ErrorAction Stop -Verbose:$false
|
Import-Module VCF.PowerCLI -ErrorAction Stop | Out-Null
|
||||||
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false `
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false `
|
||||||
-ParticipateInCEIP:$false -DisplayDeprecationWarnings:$false | Out-Null
|
-ParticipateInCEIP:$false -DisplayDeprecationWarnings:$false | Out-Null
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ try {
|
|||||||
if (-not (Get-Module -ListAvailable -Name Posh-ACME)) {
|
if (-not (Get-Module -ListAvailable -Name Posh-ACME)) {
|
||||||
Install-Module Posh-ACME -Force -Scope AllUsers
|
Install-Module Posh-ACME -Force -Scope AllUsers
|
||||||
}
|
}
|
||||||
Import-Module Posh-ACME -ErrorAction Stop -Verbose:$false
|
Import-Module Posh-ACME -ErrorAction Stop | Out-Null
|
||||||
Write-Log INFO "Posh-ACME loaded."
|
Write-Log INFO "Posh-ACME loaded."
|
||||||
} catch { Show-Failure $_ }
|
} catch { Show-Failure $_ }
|
||||||
|
|
||||||
@@ -180,28 +180,28 @@ if (-not $paCert) {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------------------
|
|
||||||
# Certificate file resolution
|
|
||||||
# ----------------------------
|
|
||||||
$certFolder = Split-Path $paCert.CertFile -Parent
|
|
||||||
|
|
||||||
$certPath = Join-Path $certFolder "cert.cer"
|
|
||||||
$keyPath = Join-Path $certFolder "cert.key"
|
|
||||||
$chainPath = Join-Path $certFolder "chain.cer"
|
|
||||||
|
|
||||||
Write-Log INFO "Using cert folder: $certFolder"
|
|
||||||
Write-Log INFO " CERT : $certPath"
|
|
||||||
Write-Log INFO " KEY : $keyPath"
|
|
||||||
Write-Log INFO " CHAIN: $chainPath"
|
|
||||||
|
|
||||||
foreach ($f in @($certPath,$keyPath,$chainPath)) {
|
|
||||||
if (-not (Test-Path $f)) {
|
|
||||||
Write-Log ERROR "Missing cert file: $f"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($needNewCert) {
|
if ($needNewCert) {
|
||||||
|
# # ----------------------------
|
||||||
|
# # Certificate file resolution
|
||||||
|
# # ----------------------------
|
||||||
|
# $certFolder = Split-Path $paCert.CertFile -Parent
|
||||||
|
#
|
||||||
|
# $certPath = Join-Path $certFolder "cert.cer"
|
||||||
|
# $keyPath = Join-Path $certFolder "cert.key"
|
||||||
|
# $chainPath = Join-Path $certFolder "chain.cer"
|
||||||
|
#
|
||||||
|
# Write-Log INFO "Using cert folder: $certFolder"
|
||||||
|
# Write-Log INFO " CERT : $certPath"
|
||||||
|
# Write-Log INFO " KEY : $keyPath"
|
||||||
|
# Write-Log INFO " CHAIN: $chainPath"
|
||||||
|
#
|
||||||
|
# foreach ($f in @($certPath,$keyPath,$chainPath)) {
|
||||||
|
# if (-not (Test-Path $f)) {
|
||||||
|
# Write-Log ERROR "Missing cert file: $f"
|
||||||
|
# exit 1
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Add CA chain to trusted store (remove duplicates)
|
# Add CA chain to trusted store (remove duplicates)
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user