how to solve the error "Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - La chaîne de certificats a été"

Marnelle M'BENGUET 20 Reputation points
2023-05-23T09:49:55.54+00:00

Hi I try to connect my asp.net core api to a sql server database I encounter an error like: "Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was provided by an authority that is not trusted.)", this error I encountered long before and had add the following properties: "TrustServerCertificate=True" and "Trusted_connection=True" but I encounter the same error I added these properties but I have the same error, what can cause this?

Developer technologies ASP.NET ASP.NET Core
SQL Server Other
{count} votes

7 answers

Sort by: Most helpful
  1. MADHUSUDHAN V 0 Reputation points
    2024-10-08T09:30:12.2166667+00:00

    ignore this please

    0 comments No comments

  2. Prateek Kumar 0 Reputation points
    2024-10-23T08:32:46.6266667+00:00
    "TrustServerCertificate=true"
    

    I fixed it by adding "TrustServerCertificate=true" to the connectionString.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.