Home > Software design >  Error with pfx certificate "The specified network password is not correct."
Error with pfx certificate "The specified network password is not correct."

Time:03-26

I am trying to run a console application that accesses an API using a pfx certificate and I am getting the following error.

2022-03-21 11:25:22.0244 - ERROR: Internal.Cryptography.CryptoThrowHelper WindowsCryptographicException: The specified network password is not correct. at Internal.Cryptography.Pal.CertificatePal.FilterPFXStore(ReadOnlySpan'1 rawData, SafePasswordHandle password, PfxCertStoreFlags pfxCertStoreFlags) at Internal.Cryptography.Pal.CertificatePal.FromBlobOrFile(ReadOnlySpan'1 rawData, String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) at ADP_API.APICall.GetHttpClientHandler() in E:\repos\ADP_API\ADP_API\APICall.cs:line 315 at ADP_API.APICall.Authenticate() in E:\repos\ADP_API\ADP_API\APICall.cs:line 79

Running the application works on my local machine and my co worker's machine. The pfx file was created with no password therefore doesn't require one. When we try to run it on a server running Windows Server 2012 it says the specific network password is not correct.

I tried installing the certificate on the server and when I try to continue from the window that asks for a password, it responds with "The password you entered is incorrect.". I tried installing it on my local machine again and it allows me to pass through the password window with no password.

I tried adding the .key and .pem files in the same folder as the pfx file and no luck with that either.

CodePudding user response:

We tried installing the certificate on one of our servers with Windows Server 2019 and it worked. After we tried this I saw Robert's comment above and it appears he is correct. Thank you Robert.

Windows 2012 is outdated and won't work for a PFX file. Solution is going to a newer Windows Server.

  • Related