CertificateDsc
CertificateDsc copied to clipboard
When using content option on PfxImport with certificate twice in pfx private key gets lost
I generated my pfx file with ansible and included the fullchain also, to ensure no intermediate certificates are missing. But the fullchain file also includes the certificate itself, so the certificate gets added a second time to the pfx file, this seems to break the private key import using Import-PfxCertificateEx @importPfxCertificateParameters -Base64Content $Content. As I don't see a point to get this point handled in code, I think this should be documented.
This will result in such an error for example: https://techcommunity.microsoft.com/t5/iis-support-blog/error-hresult-0x80070520-when-adding-ssl-binding-in-iis/ba-p/377281