简体   繁体   English

“填充无效,无法删除。”出现错误

[英]“Padding is invalid and cannot be removed.” error with a twist

I'm getting the following error in our QA environment but only through the IIS7 reverse proxy. 我在质量检查环境中遇到以下错误,但仅通过IIS7反向代理。 If I hit the application server directly it works fine. 如果我直接打应用程序服务器,它将正常工作。 In our DEV environment it works fine through the proxy or directly. 在我们的DEV环境中,它可以通过代理或直接运行正常。

I'm not really sure where to go with this, any ideas? 我真的不确定要去哪里,有什么想法吗?

Server Error in '/' Application.
Padding is invalid and cannot be removed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[CryptographicException: Padding is invalid and cannot be removed.]
   System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) +2910
   System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) +286
   System.Security.Cryptography.CryptoStream.FlushFinalBlock() +51
   System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) +318
   System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) +115
   System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +140
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171


Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927 

If this is happens on page with out post back then probably your proxy is convertting the url in lowercase chars and break the code. 如果这种情况发生在没有回发的页面上,则可能是您的代理将URL转换为小写字符并破坏了代码。

I have one more bigger answer here with a trick to log the error and see whats really get on your page: 在这里,我还有一个更大的答案,它提供了一个记录错误并查看页面上真正内容的技巧:

CryptographicException: Padding is invalid and cannot be removed and Validation of viewstate MAC failed CryptographicException:填充无效,无法删除,并且验证视图状态MAC失败

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 解密AES给我“填充无效,无法删除。”错误 - Decrypting AES gives me “Padding is invalid and cannot be removed.” error 填充无效,无法删除。 Rjindaal加密 - Padding is invalid and cannot be removed. Rjindaal encryption c# AES 解密错误并显示“填充无效且无法删除”。 - c# AES decryption errors with “Padding is invalid and cannot be removed.” C#:AES错误:填充无效,无法删除。 相同的钥匙和一切,帮助 - C#: AES error: Padding is invalid and cannot be removed. Same key and everything, help TRIPLEDES 填充无效且无法删除。 c#解密 - TRIPLEDES padding is invalid and cannot be removed. c# decrypt 不断收到“CryptographicException: Padding is invalid and cannot be removed”。 即使有填充,AES CBC 加密也会出错 - Keep getting “CryptographicException : Padding is invalid and cannot be removed.” errors with AES CBC encryption even with padding 填充无效,无法删除。 c#解密AES Rijndael,AES托管 - Padding is invalid and cannot be removed. c# decrypt AES Rijndael, AES Managed 使用Crypto-JS和C#解密的AES加密-避免“填充无效且无法删除。” - AES encryption with Crypto-JS and C# Decryption - avoiding “Padding is invalid and cannot be removed.” CryptoStream错误填充无效,无法删除 - CryptoStream error Padding is invalid and cannot be removed 错误RijndaelManaged,“填充无效,无法删除” - Error RijndaelManaged, “Padding is invalid and cannot be removed”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM