我们已经在经典 ASP 应用程序中引入了一些 .NET 页面。当用户点击其中一个 .NET 页面时,我们使用 HttpWebRequest 通过将请求发送到具有我们想要的会话变量名称的 Class ASP 页面来从 ASP 端获取会话变量值。此方法有效,但以下情况除外。
在我们的生产服务器上,我们的 IT 人员通过一些注册表黑客行为禁用了弱密码算法。我们想强制 128 超过 128(或者我被比我更了解安全的人告诉我)。但是,这会导致我们的会话共享请求中止并出现以下错误。
The request was aborted: Could not create SSL/TLS secure channel
如本文所述,我们打开了跟踪日志记录。相关行似乎是这些。
System.Net Information: 0 : [3892] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = 1b6acdd0:171a28, targetName = secure.xxx.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [3892] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=AlgorithmMismatch).
System.Net.Sockets Verbose: 0 : [3892] Socket#18136189::Dispose()
System.Net Error: 0 : [3892] Exception in the HttpWebRequest#51004322:: - The request was aborted: Could not create SSL/TLS secure channel.
System.Net Error: 0 : [3892] Exception in the HttpWebRequest#51004322::GetResponse - The request was aborted: Could not create SSL/TLS secure channel.
我可以从这些信息中得到的唯一信息是问题是AlgorithmMismatch,但我不知道该怎么做。
我读过但我们没有尝试过的一件事是在我们发出请求之前添加以下代码。这样一个简单的改变似乎有可能解决这个AlgorithmMismatch吗?
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3