Trying to diagnose a problem in a capture attempt. Got this error after downloading a brand new .p12 key for the Simple Order API. Is this a local situation where somehow the app pool has lost access to the folder where the key file is located? I get a different error if I use an expired key - it tells me the key is expired.
Update: The .p12 file seems to be getting blocked by the server. This is something new I haven't seen before.
Using powershell to unblock the .p12 file does not seem to have worked. The same error is still happening.
2023-08-15 14:06:49.315 00037 TRANSTART >
2023-08-15 14:06:49.315 00037 CONFIG > keysDirectory=c:\_certificates\,sendToProduction=False,keyFilename=mid.p12,effectiveServerURL=https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor
2023-08-15 14:06:49.362 00037 EXCEPTION >
System.Security.Cryptography.CryptographicException:
The specified network password is not correct.
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromFile(String fileName, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)
at System.Security.Cryptography.X509Certificates.X509Utils.LoadCertFromFile(String fileName, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle pCertCtx)
at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags)
at CyberSource.Clients.SoapClient.RunTransaction(Configuration config, RequestMessage requestMessage)
This appears to be a problem with Windows Server 2012 R2. Some recent change in that environment in TEST seems to have made it so the existing code which is running the Simple Order API can no longer open the security key .p12 file. Moving the application to a Windows Server 2016 environment resolved the issue with no code changes. It would seem like Cybersource has made some changes that caused this. Their support team told me they made a change to the certificate files which did break the Simple Order API for some customers, but regenerating the file resolved the issue for those people. Since this did not work for me, but moving it to the newer server did, I believe there is an incompatibility between Server 2012 R2 and whatever changes Cybersource has made. They were not willing or able to tell me more about this incompatibility issue. If anyone else encounters this, it seems like the only solution is to migrate to a later version of Windows Server.