【问题标题】:HttpWebRequest results in "The request was aborted: Could not create SSL/TLS secure channel"HttpWebRequest 导致“请求中止:无法创建 SSL/TLS 安全通道”
【发布时间】:2011-02-25 01:08:19
【问题描述】:

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

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

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

【问题讨论】:

  • ASP 盒子和后端的操作系统是什么?后端禁用了哪些算法?

标签: ssl httpwebrequest webexception


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2021-02-27
    • 2016-06-30
    • 2017-12-10
    • 2020-09-23
    • 2018-06-17
    • 2023-04-08
    • 1970-01-01
    • 2012-06-05
    相关资源
    最近更新 更多