首页 > 解决方案 > Outlook 插件使用的 TLS 版本

问题描述

不是 .NET 和 Outlook 添加开发方面的专家。但是必须在现有的前景中寻找问题添加:)。

我们的 Outlook 插件通过 HTTPS 与基于 Java 的服务器进行通信。我的 Outlook 插件是 4.5.1 .NET 版本。

现在我们的服务器支持 TLS 1.0、1.1 和 1.2。

但是我在我们的 Outlook 中看到此代码添加

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

据我了解,此代码可确保根据此 https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager.securityprotocol?view=netcore的服务器支持的 TLS 版本进行通信-3.1

如果客户端和服务器都支持 1.2,我不知道通信是否应该在我的情况下通过最高安全平台进行。

但我仍然看到通信发生的时间小于 < 1.2。不知道为什么会这样。根据文档,我了解操作系统设置不会影响 .NET 版本低于 4.7 的 TLS 版本。

并且上述代码是否正确并确保通信应该在最高安全版本上进行。?

此致,

索拉夫

标签: .netoutlook-addintls1.2

解决方案


我的 Outlook 插件是 4.5.1 .NET 版本。

System.Net.ServicePointManager.SecurityProtocol.NET 4.0/4.5 中的默认值为SecurityProtocolType.Tls|SecurityProtocolType.Ssl3. 但是,如果您在启动时使用以下代码,那么一切都应该顺利进行:

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

但我仍然看到通信发生的时间小于 < 1.2。不知道为什么会这样。

您需要检查服务器端的设置。我建议使用 Fiddler 来查看低级别发生了什么以及为什么选择较低的 TLS 版本。


推荐阅读