c# - 异常 : The requested security protocol is not supported c#

标签 c# asp.net .net windows-server-2012-r2 .net-framework-version

异常:请求的安全协议(protocol)不支持 c#。

我的应用程序使用 .net Framework 3.5 并在服务器 Windows 2012 R2 上运行。在我开始收到异常之后 “基础连接已关闭:发送时发生意外错误。” 我更改了代码并将协议(protocol)安全性定义如下-

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072 | (安全协议(protocol)类型)768; |安全协议(protocol)类型.Ssl3 | SecurityProtocolType.Tls;

在我的本地环境中更改我的代码后开始工作,但在 Live 服务器上仍然有问题。

“不支持请求的安全协议(protocol)。”

我已经定义了可能的安全协议(protocol),但相同的代码仍然不适用于 Live。

另外,由于我们使用的版本限制,我们目前无法升级框架。

请提出建议。

最佳答案

根据我的研究和引用许多博客,我发现 .NET 3.5 或更低版本。不支持 TLS 1.2 (*),并且没有解决方法。将您的应用程序升级到更新版本的框架。

引用链接:https://blogs.perficient.com/2016/04/28/tsl-1-2-and-net-support/

关于c# - 异常 : The requested security protocol is not supported c#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52196694/

相关文章:

c# - 如何从.NET Core API调用Azure门户中的函数App

c# - 网站中的设置类

c# - 使用自定义条件和分隔符拆分字符串

c# - 为什么 .NET 运行时会在我的字符串中添加下划线?

c# - 将 vb.net 转换为 c#-优化参数传递

c# - 设计器中的 ContextMenuStrip 事件

c# - 使用 SmtpClient 发送文件附件

asp.net - 数据库隔离模型

c# - 如何通过jquery/javascript获取更新后的隐藏字段值代码

.net - 正则表达式匹配区分大小写