为 WinHTTP 配置安全协议选项

本操作指南介绍了如何使用 DefaultSecureProtocols 注册表项选择 Windows HTTP 服务 (WinHTTP) 的协议。

注册表项 DefaultSecureProtocols 允许你指定当使用了 WINHTTP_OPTION_SECURE_PROTOCOLS 标志时应使用哪些 SSL 协议。 该设置使得构建为使用 WinHTTP 默认标志的应用程序能够使用较新的 TLS 协议,或者不需要对应用程序进行任何更新便可阻止较旧的基于 SSL 的协议。

Prerequisites

配置 DefaultSecureProtocols

选择要添加的体系结构类型并设置 DefaultSecureProtocols 注册表项:

  1. 打开提升的 PowerShell 命令提示符。

  2. 若要创建和设置 DefaultSecureProtocols 注册表项,请运行以下命令并将 {value} 替换为你在DefaultSecureProtocols中选择的 值。

    Get-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp" | New-ItemProperty -Name "DefaultSecureProtocols" -Value "{value}"
    
  3. 重启计算机或重新启动使用 WinHTTP 的任何服务。

后续步骤

  • 若要为多台计算机配置 DefaultSecureProtocols 注册表项,请参阅 “配置服务项”。