You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details of the scenario you tried and the problem that is occurring
I have a PFX as base64 with no password. When I use the pfxImport resource with the Content property and a null Credential, I get the error Cannot find an overload for "Import" and the argument count: "2"
Verbose logs showing the problem
Cannot find an overload for "Import" and the argument count: "2".
+ CategoryInfo : NotSpecified: (:) [], CimException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
+ PSComputerName : localhost
Exception calling "Add" with "1" argument(s): "pCertContext is an invalid handle."
+ CategoryInfo : NotSpecified: (:) [], CimException
+ FullyQualifiedErrorId : CryptographicException
+ PSComputerName : localhost
VERBOSE: [redacted]: [[PfxImport]sslImport] Set-TargetResource: Setting Certificate ''
from 'LocalMachine' store 'My' friendly name to 'redacted'. (PI0011)
VERBOSE: [CEESO-PINQ02]: LCM: [ End Set ] [[PfxImport]sslImport] in 0.5810 seconds.
The PowerShell DSC resource '[PfxImport]sslImport' with SourceInfo '::23::9::pfxImport' threw one or more
non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel
called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost
Suggested solution to the issue
System.Security.Cryptography.X509Certificates.X509Certificate2.Import does not have an overload that takes two parameters. The Modules/CertificateDsc.Common/CertificateDsc.Common.psm1 module attempts to call the Import method with 2 parameters here.
I think it should be using the overload that includes an empty string for the password.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Details of the scenario you tried and the problem that is occurring
I have a PFX as base64 with no password. When I use the pfxImport resource with the Content property and a null Credential, I get the error
Cannot find an overload for "Import" and the argument count: "2"
Verbose logs showing the problem
Suggested solution to the issue
System.Security.Cryptography.X509Certificates.X509Certificate2.Import does not have an overload that takes two parameters. The Modules/CertificateDsc.Common/CertificateDsc.Common.psm1 module attempts to call the Import method with 2 parameters here.
![image](https://user-images.githubusercontent.com/7267334/128908051-8e6179e6-6b44-4bea-80d0-ec27d76cbb3f.png)
I think it should be using the overload that includes an empty string for the password.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
OsName : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture : 64-bit
WindowsVersion : 1809
WindowsBuildLabEx : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage : en-US
OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
PSRemotingProtocolVersion 2.3
BuildVersion 10.0.17763.1852
PSVersion 5.1.17763.1852
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSEdition Desktop
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
Version of the DSC module that was used ('dev' if using current dev branch)
5.1.0
The text was updated successfully, but these errors were encountered: