Microsoft提供了有关传输层安全性(TLS)的最佳做法指南。本文档介绍了可以启用或禁用特定协议(protocol)的注册表项。

https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls#configuring-schannel-protocols-in-the-windows-registry

例如,要启用TLS 1.2,可以添加以下注册表项。

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:FFFFFFFF

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:FFFFFFFF
DisabledByDefaultEnabled有什么区别?他们似乎多余。

最佳答案

SCHANNEL_CRED structurepassed to AcquireCredentialsHandle as part of setting up a secure channel中,您可以选择在grbitEnabledProtocols位掩码字段中手动选择要支持的协议(protocol)。

因此, Enabled决定了您可以在此处启用的协议(protocol),而DisabledByDefault指定了如果您省略此字段(即,将其保留为0),则是否启用该协议(protocol)。

  • 除了将DisabledByDefault设置为1之外,Managing SSL/TLS Protocols and Cipher Suites for AD FS | Microsoft Docs文章还建议针对禁用的协议(protocol)将Enabled设置为0。因此,看起来像无条件使用DisabledByDefault来自动生成该字段的值(如果省略了该值)。

  • 该字段的注释说,不建议在新代码中使用它。因此,这两个注册表值几乎是多余的:



    目前尚不清楚如果尝试使用未启用的协议(protocol)会发生什么。从最后一段和a lack of any relevant AcquireCredentialsHandle error code for this case来看,我的猜测是它可能被忽略了。

    09-12 06:42