SqlClient: Cannot connect to SQL Server

On my development machine EF successfully connecting to SQL Server, I’ve deployed the .NET 6 app with EF Core 7 on Windows Server 2012r2 and SQL Server 2014. Now I’m getting this error message:

A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

I’ve included TrustServerCertificate=True in connection string with no luck.

In server log I can see these errors:

A fatal alert was generated and sent to the remote endpoint. This may result in termination of the connection. The TLS protocol defined fatal error code is 10. The Windows SChannel error state is 1200.

A fatal alert was generated and sent to the remote endpoint. This may result in termination of the connection. The TLS protocol defined fatal error code is 10. The Windows SChannel error state is 1202.

What can be the issue? Login and password are correct.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 27 (3 by maintainers)

Most upvoted comments

The issue will be fixed in the next update of CryptoPro CSP

Is all working after remove of CryptoPro?

yeah

@alex-radch , we’ve deployed a test server and I can confirm the issue with CryptoPro (tested without Kaspersky Antivirus installed), before installing CryptoPro CSP everything is working as expected. I’ve tried even with the latest version of CryptoPro CSP and the issue still remains

Upd: I’ve created a support ticket to CryptoPro

@Bykiev I’m already trying to ask system administrator for this. But I also can’t say how long it will take

Got it, thank you! If you will not respond till the end of the week, we’ll test on our side, but it’ll take some time

This doesn’t look related to EF Core, moving to the SqlClient repo.