System.NotSupportedException:“The requested security protocol is not supported.”

¥20.00

.Net Core 通过HttpWebRequest请求Https接口,抛出异常报错:System.NotSupportedException:“The requested security protocol is not supported.”



这个问题该怎么解决呢,我的开发环境是.net core 3.1的


System.NotSupportedException:“The requested security protocol is not supported.”



最佳解决方案

原因分析

The requested security protocol is not supported的意思是:请求安全协议不支持,也就是当前指定的几个协议SecurityProtocol里面有不被支持的协议

可以看下你请求的接口使用的协议版本,和接口的SSL版本一致就不可以。其他没有用用到的可以移除。

下面以firefox为例演示如何查看https接口的ssl协议版本

一、在浏览器里面打开接口,不用管接口是否报错的

点击小锁图标如下图:

查看SSL版本

二、点击安全链接后面的箭头


image.png


三、更多信息

image.png


四、查看“技术细节”,查看下接口地址使用的SSL版本


image.png

程序人生 T0 被采纳率100%
2021-03-05 17:19
打赏 0 1
页面统计
4953 访问
0 帮助
0.00 打赏

hierror 2019 © hierror.com 京ICP备13026190号-1

通知消息
  • 暂无任何消息