mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Merge pull request #245 from haxtibal/bugfix/find_pfx_cert
Fix loading certificate from .pfx file
This commit is contained in:
commit
221973a964
1 changed files with 1 additions and 2 deletions
|
|
@ -10,8 +10,7 @@ function Get-IcingaSSLCertForSocket()
|
||||||
# to get a proper certificate
|
# to get a proper certificate
|
||||||
if ([string]::IsNullOrEmpty($CertFile) -eq $FALSE) {
|
if ([string]::IsNullOrEmpty($CertFile) -eq $FALSE) {
|
||||||
if ((Test-Path $CertFile)) {
|
if ((Test-Path $CertFile)) {
|
||||||
$FileType = Get-Item -Path $CertFile;
|
if ([IO.Path]::GetExtension($CertFile) -eq '.pfx') {
|
||||||
if ($FileType -eq '.pfx') {
|
|
||||||
return (New-Object Security.Cryptography.X509Certificates.X509Certificate2 $CertFile);
|
return (New-Object Security.Cryptography.X509Certificates.X509Certificate2 $CertFile);
|
||||||
} else {
|
} else {
|
||||||
return ConvertTo-IcingaX509Certificate -CertFile $CertFile;
|
return ConvertTo-IcingaX509Certificate -CertFile $CertFile;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue