Skip to content

Commit

Permalink
FIX: Include Encrypt=false on local connection string (#20)
Browse files Browse the repository at this point in the history
Because of [one EF Core 7 breaking
change](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/breaking-changes#encrypt-defaults-to-true-for-sql-server-connections),
the `Encrypt` option for SQL Server connections is enabled by default.
In order to mitigate inconveniences for local development environments,
the default connection string is moved to `appsettings.Development.json`
where it includes the `Encrypt=false` flag.
If the developer wants to enforce this or not on a Release build, it's
up to them when building the solution.

Co-authored-by: Gonzalo Fernández <[email protected]>
  • Loading branch information
CesarD and Gonzo345 authored Dec 15, 2022
1 parent 7a81b4a commit 9fe1c94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Content/Monaco.Template.Api/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"ConnectionStrings": {
"AppDbContext": "Server=.;Initial Catalog=MonacoTemplate;Integrated Security=true;Encrypt=False;"
},

"EnableEFSensitiveLogging": true,

//#if (!disableAuth)
Expand Down
2 changes: 1 addition & 1 deletion src/Content/Monaco.Template.Api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"AllowedHosts": "*",

"ConnectionStrings": {
"AppDbContext": "Server=.;Initial Catalog=MonacoTemplate;Integrated Security=true;"
"AppDbContext": ""
},

"CorsPolicies": [
Expand Down

0 comments on commit 9fe1c94

Please sign in to comment.