.NET4.0 加密通讯协议下TLS 的兼容支持问题.
Study From
https://stackoverflow.com/questions/28286086/default-securityprotocol-in-net-4-5
The default System.Net.ServicePointManager.SecurityProtocol in both .NET 4.0/4.5 is SecurityProtocolType.Tls|SecurityProtocolType.Ssl3.
.NET 4.0 supports up to TLS 1.0 while .NET 4.5 supports up to TLS 1.2
However, an application targeting .NET 4.0 can still support up to TLS 1.2 if .NET 4.5 is installed in the same environment. .NET 4.5 installs on top of .NET 4.0, replacing System.dll.
I've verified this by observing the correct security protocol set in traffic with fiddler4 and by manually setting the enumerated values in a .NET 4.0 project:
ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 |
(SecurityProtocolType)768 | (SecurityProtocolType)3072;
Reference:
namespace System.Net
{
[System.Flags]
public enum SecurityProtocolType
{
Ssl3 = ,
Tls = ,
Tls11 = ,
Tls12 = ,
}
}
If you attempt the hack on an environment with ONLY .NET 4.0 installed, you will get the exception:
Unhandled Exception: System.NotSupportedException: The requested security protocol is not supported. at System.Net.ServicePointManager.set_SecurityProtocol(SecurityProtocolType v alue)
However, I wouldn't recommend this "hack" since a future patch, etc. may break it.*
Therefore, I've decided the best route to remove support for SSLv3 is to:
- Upgrade all applications to
.NET 4.5 Add the following to boostrapping code to override the default and future proof it:
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
*Someone correct me if this hack is wrong, but initial tests I see it works
.NET4.0 加密通讯协议下TLS 的兼容支持问题.的更多相关文章
- HslCommunication库的二次协议扩展,适配第三方通讯协议开发,基础框架支持长短连接模式
本文将使用一个gitHub开源的项目来扩展实现二次协议的开发,该项目已经搭建好了基础层架构,并实现了三菱,西门子,欧姆龙,MODBUS-TCP的通讯示例,也可以参照这些示例开发其他的通讯协议,并Pul ...
- CPU卡中T=0通讯协议的分析与实现
IC卡的应用越来越广泛,从存储卡到逻辑加密卡,目前CPU卡已经逐渐在应用中占据主导地位.CPU卡根据通讯协议可分为两种:接触式和非接触式.接触式CPU卡主要采用两种通讯协议:T=0和T=1通讯协议.T ...
- EFK教程(4) - ElasticSearch集群TLS加密通讯
基于TLS实现ElasticSearch集群加密通讯 作者:"发颠的小狼",欢迎转载 目录 ▪ 用途 ▪ ES节点信息 ▪ Step1. 关闭服务 ▪ Step2. 创建CA证书 ...
- SSL/TLS协议详解(下)——TLS握手协议
本文转载自SSL/TLS协议详解(下)--TLS握手协议 导语 在博客系列的第2部分中,对证书颁发机构进行了深入的讨论.在这篇文章中,将会探索整个SSL/TLS握手过程,在此之前,先简述下最后这块内容 ...
- EFK-4::ElasticSearch集群TLS加密通讯
转载自:https://mp.weixin.qq.com/s?__biz=MzUyNzk0NTI4MQ==&mid=2247483822&idx=1&sn=6813b22eb5 ...
- 基于dubbo框架下的RPC通讯协议性能测试
一.前言 Dubbo RPC服务框架支持丰富的传输协议.序列化方式等通讯相关的配置和扩展.dubbo执行一次RPC请求的过程大致如下:消费者(Consumer)向注册中心(Registry)执行RPC ...
- Ntrip通讯协议1.0
Ntrip通讯协议1.0 1 什么是Ntrip? CORS(Continuously Operating Reference Stations)就是网络基准站,通过网络收发GPS差分数据.用户访问CO ...
- asp.net 项目Net4.0 在IE10、 IE 11 下出现 “__doPostBack”未定义 的解决办法
我的项目中,服务器端是Windows Server2008 64位,.net版本是4.0,也遇到了树形结构控件.DropDownList控件等不能调用服务器端代码.最后发现js报错. 错误信息:“__ ...
- .NET4.0下网站应用法度用UrlRewriter.dll重写无后缀路径 (在IIS7.5中的设备办法)
.NET4.0下网站应用法度用UrlRewriter.dll重写无后缀路径 在IIS中新建网站(端标语8111) 直接运行http://localhost:8111/ 设备办法: 二.添加通配符脚本映 ...
随机推荐
- 【转载】完成C++不能做到的事 - Visitor模式
原文: 完成C++不能做到的事 - Visitor模式 拿着刚磨好的热咖啡,我坐在了显示器前.“美好的一天又开始了”,我想. 昨晚做完了一个非常困难的任务并送给美国同事Review,因此今天只需要根据 ...
- 【HNOI2007】紧急疏散
题面 题解 \(\text{HNOI2007}\)真的恐怖 这是集合了所罗门的咒语,胜负一子等神仙题和码农题的一年 所以这道题非常码 二分答案,将门拆点,于是就变成了一个二分图匹配的题目 反正很恶心 ...
- 【mysql】排序方法
查询各科成绩前三名的记录,不考虑并列的情况: select a.course_id as 课程ID, a.score as 成绩, count(a.course_id) as 排名 from scor ...
- 【译】2017年要学习的三个CSS新特性
这是翻译的一篇文章,原文是:3 New CSS Features to Learn in 2017,翻译的不是很好,如有疑问欢迎指出. 新的一年,我们有一系列新的东西要学习.尽管CSS有很多新的特性, ...
- Java线程wait和sleep的区别
Java中调用wait方法或者sleep方法都可以让线程进入waitint或者time-waiting状态,但是它们还是 有所不同的: wait是Object中的方法,而sleep则是Thread中的 ...
- Java 快排 排序
一.快排的一种 ==================== public class myMain { public static void main(String[] args) { int t[] ...
- PASSWORD MySQL 5.6.21-1ubuntu14.04_amd64
/***************************************************************************** The main idea is that ...
- SQL面经汇总
转载链接:https://www.nowcoder.com/discuss/95812 目前的打算是还要写一个假设检验的汇总和机器学习的汇总. 之前写的概率论汇总: https://www.nowco ...
- type命令详解
转自:http://codingstandards.iteye.com/blog/831504 在脚本中type可用于检查命令或函数是否存在,存在返回0,表示成功:不存在返回正值,表示不成功. $ t ...
- Java多线程编程之不可变对象模式
在多线程环境中,为了保证共享数据的一致性,往往需要对共享数据的使用进行加锁,但是加锁操作本身就会带来一定的开销,这里可以使用将共享数据使用不可变对象进行封装,从而避免加锁操作. 1. 模 ...