I've been upgrading an application from .net6 to .net 7 and I cannot connect to the database.
below is the connection string
"ConnectionStrings": {
"DefaultConnection": "Server=.\\MYINSTANCE;Database=MyDatabase;User Id=MyUser; Password=MyPassoword;MultipleActiveResultSets=True;"
}
And the connection
var connectionString = _configuration.GetConnectionString("DefaultConnection");
var connection = new SqlConnection(connectionString);
connection.Open();
Which works great in dotnet 6, however once i update to 7 it stops giving me the following 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 - The certificate chain was issued by an authority that is not trusted.) ---> System.ComponentModel.Win32Exception (0x80090325): The certificate chain was issued by an authority that is not trusted.
Does anyone have any ideas on this or why this is happing?