在调用接口前设置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);
标签:TLS,C#,SSL,var,new,SecurityProtocolType,HttpClient From: https://www.cnblogs.com/jxw-29/p/17188474.html