简体   繁体   English

EWS和TLS 1.2-自动连接出现问题

[英]EWS and TLS 1.2 - having issues connecting automatically

One of our clients has upgraded to Tls 1.2. 我们的一位客户已升级到Tls 1.2。

However, the ExchangeService client has problems connecting to it, unless I add the following code: 但是,除非我添加以下代码,否则ExchangeService客户端无法连接到它:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

This likely won't work for all of our clients. 这可能不适用于我们的所有客户。 Is there a way to make it detect which one to use automatically? 有没有办法让它自动检测要使用哪个?

You can specify multiple supported protocols by doing something like this: 您可以通过执行以下操作来指定多个受支持的协议:

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

Using this sample of code, you allow all security protocols (supported by .NET). 使用此代码示例,您允许所有安全协议(.NET支持)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM