2016-11-14 208 views
1

我們的客戶之一已升級到Tls 1.2。EWS和TLS 1.2 - 自動連接問題

然而,ExchangeService客戶端連接到它的問題,除非我添加以下代碼:

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

這可能不會對所有客戶的工作。有沒有辦法讓它檢測到自動使用哪一個?

回答

2

你可以做這樣的事情指定多個支持的協議:

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

使用的代碼此示例,你允許所有的安全協議(由.NET支持)。