SQL Client SQL Exception Error

What to do if you see the error "System.Data.SqlClient.SqlException (0x80131904)"

What to do if you see the error "System.Data.SqlClient.SqlException (0x80131904)"

A Microsoft Windows/SQL server update in April of 2023 may cause issues in your environment.

In April 2023 updates, SQL server no longer trusts certificates inherently.

That statement was set to false in the base SQL code from True in the previous code.

Customers who are using HTTPS-only environments may now see the error listed below in their console:

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The handle specified is invalid) ---> System.ComponentModel.Win32Exception (0x80004005): The handle specified is invalid

How to Resolve the "System.Data.SqlClient.SqlException (0x80131904)" Error

Use the following steps to resolve this error:

  1. In SSMS check the box Trust server certificate:

    blobid1.jpg
  2. Reset Winsock on both the SQL server and the Console Server using netsh Winsock reset.
    1. This causes the system to blip for a moment
    2. Uou may have to reboot the console server.
  3. Do a single agent scan from the console.
  4. If the scan dies check the event viewer for the error below.
  5. IF the error below is seen the installation is corrupted and needs to be reinstalled.

  6. Check to make sure that C++ 2010 64-bit is installed on the Console Server.


Was this article helpful?