缓解:TLS 协议

从 .NET Framework 4.6 开始, System.Net.ServicePointManager 允许类 System.Net.Security.SslStream 使用以下三种协议之一:Tls1.0、Tls1.1 或 Tls 1.2。 不支持 SSL3.0 协议和 RC4 密码。

影响

此更改会影响:

缓解措施

建议的缓解措施是将服务器端应用升级到 Tls1.0、Tls1.1 或 Tls 1.2。 如果这不可行或者如果客户端应用被中断,则可以使用 AppContext 类并采用如两种方式中的一种来选择退出此功能:

  • 以编程方式使用如下代码段:

    const string DisableCachingName = @"TestSwitch.LocalAppContext.DisableCaching";
    const string DontEnableSchUseStrongCryptoName = @"Switch.System.Net.DontEnableSchUseStrongCrypto";
    AppContext.SetSwitch(DisableCachingName, true);
    AppContext.SetSwitch(DontEnableSchUseStrongCryptoName, true);
    
    Const DisableCachingName As String = "TestSwitch.LocalAppContext.DisableCaching"
    Const DontEnableSchUseStrongCryptoName As String = "Switch.System.Net.DontEnableSchUseStrongCrypto"
    AppContext.SetSwitch(DisableCachingName, True)
    AppContext.SetSwitch(DontEnableSchUseStrongCryptoName, True)
    

    由于对象 ServicePointManager 仅初始化一次,因此定义这些兼容性设置必须是应用程序做的第一件事。

  • 在 app.config 文件的 <runtime> 部分中添加下面的代码行:

    <AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=true"/>  
    

但是,请注意,不建议选择退出默认行为,因为这会降低应用程序的安全性。

另请参阅