diff --git a/CHANGELOG.md b/CHANGELOG.md index 252169b4..56e815cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed pipeline by replacing the GitVersion task in the `azure-pipelines.yml` with a script. +- Passed in an empty string to X509Certificate2.Import so that we do not get MethodCountCouldNotFindBest exception when using a null + password for the PFX certificate. Fixes [Issue #258](https://github.com/dsccommunity/CertificateDsc/issues/258) ## [5.1.0] - 2021-02-26 diff --git a/source/Modules/CertificateDsc.Common/CertificateDsc.Common.psm1 b/source/Modules/CertificateDsc.Common/CertificateDsc.Common.psm1 index 2db1f6ac..29132ff0 100644 --- a/source/Modules/CertificateDsc.Common/CertificateDsc.Common.psm1 +++ b/source/Modules/CertificateDsc.Common/CertificateDsc.Common.psm1 @@ -1082,7 +1082,7 @@ function Import-PfxCertificateEx } else { - $cert.Import($importDataValue, $flags) + $cert.Import($importDataValue, "", $flags) } $certStore = New-Object `