C#調用HttpClient.SendAsync報錯:System.Net.Http.HttpRequestException:
發送請求時出錯。
var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
問題出在SSL/TLS,Windows Server 2012不支持 TLS 1.2 ,需要手動設置
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;