C# - 请求被中止: 未能创建 SSL/TLS 安全通道。
在调用接口前设置TLS
HttpClient client = new HttpClient();
HttpContent httpContent = new FormUrlEncodedContent(dic);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
var responseAsString = client.PostAsync(Server + "/oauth2/token", httpContent).Result.Content.ReadAsStringAsync().Result;
var result = JsonConvert.DeserializeObject<TokenModel>(responseAsString);
浙公网安备 33010602011771号