Recently I was working on migration of an existing Asp.Net MVC project to .Net 6 (.Net Core). I started getting following error when establishing SQL connection with Microsoft SQL Server.
Exception thrown: 'Microsoft.Data.SqlClient.SqlException' in Microsoft.Data.SqlClient.dll An exception of type 'Microsoft.Data.SqlClient.SqlException' occurred in Microsoft.Data.SqlClient.dll but was not handled in user code 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 issued by an authority that is not
This is one of the breaking changes in SQL Server driver. Now the driver wants to enforce a valid security certificate for each connection. This does not mean that you do not have an option to not use this security behavior. You can set TrustServerCertificate=True. This will ensure that every SQLConnection that uses this connection string will not encounter the error mentioned above. Following is an example of a connection string I use in my application.
"Server=localhost;TrustServerCertificate=True;Database=mydatastore;uid=myuser;pwd=mypassword"The certificate chain was issued by an authority that is not trusted
Free TLS/SSL Certificate For Websites
Implement OWA style New message notifier poup using Silverlight
How to plan CCSP Exam preparation
Develop a MongoDB pipeline to transform data into time buckets
Alert and Confirm pop up using BootBox in AngularJS
AngularJS Grouped Bar Chart and Line Chart using D3
How to lock and unlock account in Asp.Net Identity provider
2024 © Byteblocks, ALL Rights Reserved. Privacy Policy | Terms of Use