gpt4 book ai didi

c# - Tls 1.2 或 Tls 1.0 与 .net 框架 4.0

转载 作者:太空宇宙 更新时间:2023-11-03 14:24:55 29 4
gpt4 key购买 nike

我有一个 .net 4.0 windows 服务,可以在两个不同的系统之间进行通信。一种是现在的服务,一种是消息传递总线。

服务现在强制使用 tls 1.2(他们应该这样做)。我们通过添加 ServicePointManager.SecurityProtocol = (SecurityProtocolType)768 | 更新代码以使用 1.1 或 1.2。 (安全协议(protocol)类型)3072;

问题,消息总线很旧,使用的是 1.0。

有没有办法同时支持这两者?如果我升级到 .net 4.7,它是否适用于所有协议(protocol)?

谢谢

最佳答案

如果服务器不支持TLS1.2,它将尝试TLS1.1,如果服务器不支持TLS1.1服务器它将尝试 TLS1.0。这将允许您使用最好的协议(protocol)并在服务器不支持它时回退,就像您的情况一样。

ServicePointManager.SecurityProtocol =  
SecurityProtocolType.Tls |
(SecurityProtocolType)768 |
(SecurityProtocolType)3072;

Is there a way to support both? If I upgrade to .net 4.7 will it work for any and all protocols?

是的(就您的问题而言,任何),我相信 .Net 4.5 及更高版本您可以做到这一点...

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

关于c# - Tls 1.2 或 Tls 1.0 与 .net 框架 4.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58019568/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com