首页 > Web开发 > 详细

.Net Core访问https接口报错:The requested security protocol is not supported

时间:2020-07-03 15:19:25      阅读:2208      评论:0      收藏:0      [点我收藏+]

需要在设置协议类型前需要先设置协议版本信息,如下:

HttpWebRequestreq = (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

原文:https://www.cnblogs.com/Jackie-sky/p/13230541.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!