简体   繁体   中英

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. 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:

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.)]

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.

1.Start the registry editor by clicking on Start and Run. Type in "regedit" into the Run field (without quotations).

2.Highlight Computer at the top of the registry tree. 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

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.

4.Right click on the TLS 1.2 key and add two new keys underneath it.

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.

6.Right-click the name Enabled and select Modify... from the drop-down menu.

7.Ensure that the Value data field is set to 0 and the Base is Hexadecimal. Click on OK.

8.Repeat the steps 5 to 7 for server key also.

hopefully i will help.

I found a solution to this issue adding this to your webconfig, will solve the issue

<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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM