I fixed it adding on my connection string the following parameters:
"Trusted_Connection=true;encrypy=false;"
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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?
I fixed it adding on my connection string the following parameters:
"Trusted_Connection=true;encrypy=false;"
Hello,
1 - Check the type of authentication configured on the SQL Server.
2 - See the example below of a complete connection string, and adapt it to your data:
"ConnectionStrings": {
"DefaultConnection": "Server=MyServerNameOrHostIP,PortNumber;Initial Catalog=Mydatabse;User Id=YourUser;Password=YourPassword;Persist Security Info=False;Trusted_Connection=False;Encrypt=False;TrustServerCertificate=True;"
}
If it works or you need clarification, leave a comment.
I would say that the best solution is to talk with your IT folks to have a proper certificate installed on the SQL Server machine, and added to the trusted certificate store on the clients.
By the way, Trusted_connection is just a synonym for Integrated Security. It is not relation to connection security as such.
Probably your SQL Server does not support TLS 1.2. Please see the following Microsoft document:
There was change in Microsoft.Data.SqlClient 4.0 as described below:
"The default value of the Encrypt connection setting has been changed from false to true."
Am facing it recently for localhost & code first migration, i tried changing to Encrypt,TrustCerticate all but nothing worked. So for me last option was,create db using Update-migration and then continue using same connection string as earlier. everything become fine.
Error:
Solution:
Step1:
Step2:Use assusual connection string.