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;