gpt4 book ai didi

ssl - HttpWebRequest 结果为 "The request was aborted: Could not create SSL/TLS secure channel"

转载 作者:太空宇宙 更新时间:2023-11-03 12:46:50 24 4
gpt4 key购买 nike

我们已经将一些 .NET 页面引入到经典 ASP 应用程序中。当用户点击其中一个 .NET 页面时,我们使用 HttpWebRequest 通过将请求发送到具有我们想要的 session 变​​量名称的类 ASP 页面来从 ASP 端获取 session 变量值。这种方法有效,但在以下情况下除外。

在我们的生产服务器上,我们的 IT 人员通过一些注册表黑客攻击禁用了弱密码算法。我们想强制 128 超过 128(或者比我更了解安全的人告诉我)。但是,这会导致我们的 session 共享请求中止并出现以下错误。

The request was aborted: Could not create SSL/TLS secure channel

我们按照 this article 中的描述开启了跟踪记录.相关行似乎是这些。

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

最佳答案

我们终于弄明白了。除了禁用弱密码外,IT 人员还调整了一些其他设置。他们已将 HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client 的启用 (DWORD) 值设置为 0。这意味着机器无法生成 SSL 请求。将该键的启用从 0 更改为 1 允许一切正常工作。

关于ssl - HttpWebRequest 结果为 "The request was aborted: Could not create SSL/TLS secure channel",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5112515/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com