通过.net框架进行TLS 1.1 / 1.2协议激活检查? [英] TLS 1.1/ 1.2 Protocol activation check via .net framework?

查看:289
本文介绍了通过.net框架进行TLS 1.1 / 1.2协议激活检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 


    我想检查Windows中的 TLS 1.1 / 1.2激活。 我遇到了基于复杂操作系统的注册表项检查,这对我来说似乎不是一个好的解决方案。是否有人知道.Net框架中的标准
方法或属性进行此类检查?




亲切的问候


Uneeb Khalid  


      

解决方案

嗨  Uneeb Khalid,


谢谢在这里发布。


对于您的问题,不同的.net框架版本支持不同的TLS。如果您不设置版本,则默认设置。您可以参考下面的MSDN文档来检查不同.net框架版本的默认TLS版本。


https://docs.microsoft.com/en-us/dotnet/framework/网络编程/ tls #if-your-app-targets-net-framework-47-later-later-versions


如果你想改变TLS,你可以使用下面的代码设置所需的TLS版本。请注意,它取决于.net框架支持的TLS版本。

 ServicePointManager.SecurityProtocol | = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls | SecurityProtocolType.Ssl3; 

请以StackOverFlow中的线程作为参考。


https://stackoverflow.com/questions/34920429/is-tls-1-1-and-tls-1-2-enabled-by-default- for-net-4-5-and-net-4-5-1?rq = 1


最好的问候,


温迪


Hi, 

     I want to check the TLS 1.1/1.2 activation in Windows.  I am come across complex operating system based Registry keys checks which does not appear to me a good solution. Is there anybody know the standard Method or Property in .Net framework for such check?

Kind Regards

Uneeb Khalid 

      

解决方案

Hi Uneeb Khalid,

Thank you for posting here.

For your question, the different .net framework version support different TLS. It would be set by default if you would not set the version. You could refer to the MSDN document below to check the default TLS version of different .net framework version.

https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls#if-your-app-targets-net-framework-47-or-later-versions

If you want to change the TLS, you could use the code below to set the TLS version you want. Please note, it depends on the which TLS version supported by the .net framework.

ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12|SecurityProtocolType.Tls|SecurityProtocolType.Ssl3;

Please take the thread in StackOverFlow for reference.

https://stackoverflow.com/questions/34920429/is-tls-1-1-and-tls-1-2-enabled-by-default-for-net-4-5-and-net-4-5-1?rq=1

Best Regards,

Wendy


这篇关于通过.net框架进行TLS 1.1 / 1.2协议激活检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆