.Net Core访问https接口报错:The requested security protocol is not supported
2021-01-26 11:15
标签:tps class pve bre cep support ida ice div 需要在设置协议类型前需要先设置协议版本信息,如下: .Net Core访问https接口报错:The requested security protocol is not supported 标签:tps class pve bre cep support ida ice div 原文地址:https://www.cnblogs.com/Jackie-sky/p/13230541.htmlHttpWebRequestreq = (HttpWebRequest)HttpWebRequest.Create(url);
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
//设置协议类型前设置协议版本
req.ProtocolVersion = HttpVersion.Version11;
//这里设置了协议类型。
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
ServicePointManager.CheckCertificateRevocationList = true;
ServicePointManager.DefaultConnectionLimit = 1000;
ServicePointManager.Expect100Continue = false;
文章标题:.Net Core访问https接口报错:The requested security protocol is not supported
文章链接:http://soscw.com/index.php/essay/47251.html