.net - 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 版本。
并且上述代码是否正确并确保通信应该在最高安全版本上进行。?
此致,
索拉夫
解决方案
我的 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 版本。
推荐阅读
- python - 烧瓶等待功能接受数据的特定时间
- typescript - 编译成独立 apk 后,expo-payments-stripe 模块失败
- elixir - 在 Elixir Phoenix 中使用 unix 邮件发送电子邮件?
- java - Java 和 PHP 中的 Hash256 不返回相同的结果
- c - 从文件中覆盖 C 中 struct 中的索引
- javascript - 将蓝色 j 程序转换为 jar 文件
- ios - 失去与设备的连接。退出 (sigterm) - Flutter Crash
- python - Pandas 基于长格式的条件总和追加行
- javascript - 角细节组件。仅显示基于 url 的数组的某些元素
- discord.py - 我如何在嵌入 discord.py 中放置 meme 和 upvotes 的标题以及 meme 的链接