I wanted to make use of a .Net 4.5 feature in my mods, so I installed .Net 4.5 on our test site server to test compatibility. I also changed EncryptionKeyManager.cs (in source code, so I won't post it unless requested by someone from AC) to use the newer PCI-compliant code in the ParseConfigFile() method. At the time, I did not have an encryption key set in Able Commerce. After installing .Net 4.5, everything worked, but I would get the following error when the site would get loaded:
Code: Select all
Unable to validate data.
Exception: Unable to validate data.
Stack Trace: at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData)
at System.Web.Security.MachineKey.Decode(String encodedData, MachineKeyProtection protectionOption)
at CommerceBuilder.Configuration.EncryptionKeyManager.ParseConfigFile()
However, this weekend I tried installing .Net 4.5 on our production site server, which already had an encryption key set. I also installed the updated CommercBuilder.dll with the new ParseConfigFile() code. When I restarted and went to the site, I got the above error and the encrypted data (UPS settings for example) did not load. I reverted the .Net 4.5 install (Shapshots on VM servers are a wonderful thing!) and removed encryption, then installed .Net 4.5 and the updated dll again. Like the test site, I got the error, but everything worked. So I added an encryption key again and everything worked. However, when I rebooted the server (which i subsequently tried several times), I kept getting the above error, and (as expected) the encrypted data was not loaded. So reverted the production server to the "before I did anything" snapshot again until I figure this out.
So in summary, my test server works fine with .Net 4.5 even after restarts, but the production server lost the ability to read the encrypted data when the server was restarted.
Can anyone from AbleCommerce comment on whether you ran into this when making R8 compatible with .Net 4.5, or when working on the new PCI-compliant ParseConfigFile, and if so, how you solved it? Anyone else seen this, or know how to work around it?