Skip to content

Commit 221973a

Browse files
authored
Merge pull request #245 from haxtibal/bugfix/find_pfx_cert
Fix loading certificate from .pfx file
2 parents b6ce0c4 + 91e37ea commit 221973a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/webserver/Get-IcingaSSLCertForSocket.psm1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ function Get-IcingaSSLCertForSocket()
1010
# to get a proper certificate
1111
if ([string]::IsNullOrEmpty($CertFile) -eq $FALSE) {
1212
if ((Test-Path $CertFile)) {
13-
$FileType = Get-Item -Path $CertFile;
14-
if ($FileType -eq '.pfx') {
13+
if ([IO.Path]::GetExtension($CertFile) -eq '.pfx') {
1514
return (New-Object Security.Cryptography.X509Certificates.X509Certificate2 $CertFile);
1615
} else {
1716
return ConvertTo-IcingaX509Certificate -CertFile $CertFile;

0 commit comments

Comments
 (0)