首页新闻找找看学习计划

netcore下请求https协议地址,异常:The remote certificate is invalid according to validation procedure

0
悬赏园豆:20 [已关闭问题] 关闭于 2019-06-05 16:50

应该是对方的https证书已过期,但是还是要用https访问。.netcore下如何解决呢?
framework下的帖子:https://www.cnblogs.com/dudu/p/3537653.html

Code_Song的主页 Code_Song | 初学一级 | 园豆:88
提问于:2019-06-05 16:46
< >
分享
所有回答(1)
0

var httpclientHandler = new HttpClientHandler();
httpclientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, error) => true;

Code_Song | 园豆:88 (初学一级) | 2019-06-05 16:50
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册