IE高级配置中支持的SSL/TLS协议对应注册表值

一、手动勾选"Internet选项->高级->安全->使用TLS 1.2"

 

二、以编程方式勾选"Internet选项->高级->安全->使用TLS 1.2"

1.注册表值SecureProtocols对应的含义

注册表的路径为:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

Key: SecureProtocols
 

配置选项及对应10进制几个组合为:
SSL2.0   00000008(8)
SSL3.0   00000020(32)
TLS1.0 00000080(128)
TLS1.1 00000200(512)
TLS1.2 00000800(2048)

TLS1.3 00002000(8192)
TLS1.1 TLS1.2   00000a00(2560)
SSL3.0 TLS1.0   000000a0(160)  //32+128=160
SSL3.0 TLS1.0 TLS1.1   000002a0(672)      
SSL3.0 TLS1.0 TLS1.2   000008a0(2208)
SSL3.0 TLS1.0 TLS1.1 TLS1.2   00000aa0(2720)
SSL2.0 SSL3.0 TLS1.0 TLS1.1 TLS1.2 00000aa8(2728)

 
2.批处理修正IE SSL协议
 

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v SecureProtocols /t REG_DWORD /d 2720 /f

3.代码修改注册表值(C#示例)

需要添加“使用Microsoft.Win32;”引用

static void Main(string[] args)
{
    // The name of the key must include a valid root.
    const string userRoot = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings";
    const string subkey = "SecureProtocols";

    //get the registry value.
    string result = (Registry.GetValue(userRoot, subkey, "Return this default if NoSuchName does not exist")).ToString();
    Console.WriteLine(result);

    //Enable TLS 1.0 and TLS 1.2 
    Registry.SetValue(userRoot, subkey, 2176);

    Console.WriteLine("OK");
    Console.ReadKey();
}
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值