简体   繁体   English

ASP.NET 4.5客户端和服务器无法通信,因为它们不具有通用算法

[英]ASP.NET 4.5 The client and server cannot communicate, because they do not possess a common algorithm

I created a project in using ASP.NET. 我使用ASP.NET创建了一个项目。 When I test locally everything is fine. 当我在本地测试时,一切都很好。 When I push to the server, I get this error on any page I make a database call to: 当我推送到服务器时,在我进行数据库调用的任何页面上都会出现此错误:

The client and server cannot communicate, because they do not possess a common algorithm 客户端和服务器无法通信,因为它们不具有通用算法

I tried to set my TLS to 1.2 in my Global.asax file with this line of code: 我尝试使用以下代码在Global.asax文件中将TLS设置为1.2:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

But that did nothing. 但这没做。

Here are more error details: 以下是更多错误详细信息:

A connection was successfully established with the server, but then an error occurred during the login process. 已成功与服务器建立连接,但是在登录过程中发生了错误。 (provider: SSL Provider, error: 0 - The client and server cannot communicate, because they do not possess a common algorithm.)] (提供者:SSL提供程序,错误:0-客户端和服务器无法通信,因为它们不具有通用算法。)

Hi all recently i got these similar issue and resolved after a longer research, pls follow the below steps. 大家好,最近我也遇到了类似的问题,经过长时间的研究后解决了,请按照以下步骤操作。 we need to enable TSL1.0,TSL1.1,SSL2 REGISTRY.BELOW R THE STEPS. 我们需要启用TSL1.0,TSL1.1,SSL2 REGISTRY。

1.Start the registry editor by clicking on Start and Run. 1.通过单击“开始并运行”来启动注册表编辑器。 Type in "regedit" into the Run field (without quotations). 在“运行”字段中输入“ regedit”(不带引号)。

2.Highlight Computer at the top of the registry tree. 2.突出显示注册表树顶部的计算机。 Backup the registry first by clicking on File and then on Export. 首先通过单击文件,然后单击导出来备份注册表。 Select a file location to save the registry file. 选择一个文件位置以保存注册表文件。

Note: You will be editing the registry. 注意:您将编辑注册表。 This could have detrimental effects on your computer if done incorrectly, so it is strongly advised to make a backup. 如果操作不正确,可能会对您的计算机产生不利影响,因此强烈建议您进行备份。

3.Browse to the following registry key: HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols 3.浏览到以下注册表项:HKEY_LOCAL_MACHINE \\ SYSTEM \\ CurrentControlSet \\ Control \\ SecurityProviders \\ SCHANNEL \\ Protocols

Right click on the Protocols folder and select New and then Key from the drop-down menu. 右键单击“协议”文件夹,然后从下拉菜单中选择“新建”,然后选择“密钥”。 This will create new folder. 这将创建新文件夹。 Rename this folder to TLS 1.2. 将此文件夹重命名为TLS 1.2。

4.Right click on the TLS 1.2 key and add two new keys underneath it. 4.右键单击TLS 1.2密钥,并在其下面添加两个新密钥。

The two new keys are: Client Server 这两个新密钥是:客户端服务器

5.Right click on the Client key and select New and then DWORD (32-bit) Value from the drop-down list. 5.右键单击Client键,然后从下拉列表中选择“新建”,然后选择“ DWORD(32位)值”。

6.Right-click the name Enabled and select Modify... from the drop-down menu. 6.右键单击名称Enabled,然后从下拉菜单中选择Modify...。

7.Ensure that the Value data field is set to 0 and the Base is Hexadecimal. 7.确保将值数据字段设置为0,并且将基数设置为十六进制。 Click on OK. 单击确定。

8.Repeat the steps 5 to 7 for server key also. 8.也对服务器密钥重复步骤5到7。

hopefully i will help. 希望我会帮助。

I found a solution to this issue adding this to your webconfig, will solve the issue 我找到了解决此问题的方法,将其添加到您的webconfig中,将解决此问题

<appSettings>
    <add key="AppContext.SetSwitch:Switch.System.Net.DontEnableSchUseStrongCrypto" value="false" />
    <add key="AppContext.SetSwitch:Switch.System.Net.DontEnableSystemDefaultTlsVersions" value="false" />
</appSettings>

Cannot set app to use system default TLS version by adding appcontext settings in web.config 无法通过在web.config中添加appcontext设置来将应用设置为使用系统默认的TLS版本

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 客户端和服务器无法通信,因为它们没有通用的 WCF 算法 - The client and server cannot communicate, because they do not possess a common algorithm WCF 客户端和服务器无法通信,因为它们没有共同的算法 - ASP.NET C# IIS TLS 1.0 / 1.1 / 1.2 - Win32 - The client and server cannot communicate, because they do not possess a common algorithm - ASP.NET C# IIS TLS 1.0 / 1.1 / 1.2 - Win32Exception 客户端和服务器无法通信,因为它们在Windows Server 2008 Web上不具有通用算法 - The client and server cannot communicate, because they do not possess a common algorithm on Windows Server 2008 Web SSLStream.AuthenticateAsServer “客户端和服务器无法通信,因为它们没有通用算法” - SSLStream.AuthenticateAsServer “The client and server cannot communicate, because they do not possess a common algorithm” 客户端和服务器无法通信,因为它们没有通用的算法C#SslStream - The client and server cannot communicate, because they do not possess a common algorithm, C# SslStream 无法创建SSL / TLS安全通道。客户端和服务器无法通信,因为它们没有通用算法 - Could not create SSL/TLS secure channel. The client and server cannot communicate, because they do not possess a common algorithm C# 客户端和服务器无法通信,因为它们没有通用的算法 - C# The client and server cannot communicate, because they do not possess a common algorithm TLS 1. 2 客户端和服务器无法通信,因为它们没有通用算法 - TLS 1. 2 The client and server cannot communicate, because they do not possess a common algorithm SoapHttpClientProtocol和TLS 1.2 - 客户端和服务器无法通信,因为它们没有通用的算法 - SoapHttpClientProtocol and TLS 1.2 - The client and server cannot communicate, because they do not possess a common algorithm HTTP Web 请求 TLS 1.3 C# .NET 核心 3.1 异常“客户端和服务器无法通信,因为它们不具备通用算法。” - HTTP Web Request TLS 1.3 with C# .NET Core 3.1 exception "The client and server cannot communicate, because they do not possess a common algorithm."
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM