-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Encrypt
property default value to true
#1210
Update Encrypt
property default value to true
#1210
Conversation
What issue is this solving? |
Doesn't this require the server to have proper SSL certificates? If so, that seems quite breaking for everyone currently happily not using SSL in internal networks... |
It depends on the value of TrustServerCertificate see https://docs.microsoft.com/en-us/sql/relational-databases/native-client/features/using-encryption-without-validation?view=sql-server-ver15 by default default is to trust the server so default configuration self signed will still allow access. EnableEncryption just forces the use of ssl and doesn't have implications for client or server certificate validation. |
This is all about the client environment configuration and possible security breaches. Also, the customers who enforce the encryption on the server don't face this breach. |
Are you sure about that? Both that table and checking the default value of SqlConnectionStringBuilder.TrustServerCertificate seem to indicate that self-signed certificates aren't trusted by default, and one has to opt in explicitly by setting |
Any connection to the server at least needs a secure login that means both sides of the connection should be possible to encrypt. So, If one side wasn't able to encrypt, establishing a secure connection shouldn't be possible. Regarding the use of |
Comment's updated. |
Ok. but I think the point was to ask why the change is being made. Is it a top down decision to require encryption at all times? |
It includes two changes:
If you asked for Encrypt default value, the quick answer is yes. But if you asked for the encryption process, I delegate it to @David-Engel. |
There are two issues being addressed here:
|
Thanks, makes sense doing this for version 4! |
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserSafeHandles.cs
Outdated
Show resolved
Hide resolved
LGTM. I wait for other teammate opinion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some minor suggestions.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Cheena Malhotra <v-chmalh@microsoft.com>
This caused downtime for our production Logic Apps talking to SQL as we are using self-signed SSL certs on SQL and hadn't declared trustservercertificates. I am 100% onboard with the change I just wish this had been communicated to users of Logic Apps for example. We have no ability/visibility to track potential changes like this via the underlying Logic Apps stack, we rely on Microsoft to surface and communicate breaking changes in advance, it's clear from this issue that this was known to be a breaking change before it was merged. I assume as this was merged a year ago but we only experienced the change a couple of weeks ago that Logic Apps have only just updated to this version of dotnet. |
We have experienced this same type of issue during testing of our own apps which utilise the Serilog MSSQL sink - had it not been for the fact that their changelog included the breaking change link for this lib we would've been in a bit of a pickle, so appreciate both ends declaring this - although it perhaps highlights the need for our end to look deeper into checking dependencies of dependencies before pushing something out for testing. |
It would've been nice if an example was included in the documentation on how to revert to the original behaviour. |
Using SqlClient V4 I am expecting the connection string to require |
TrustServerCertificate is not required if the server's certificate is implicitly trusted by the client, e.g. it is issued by a certificate authority that has a root certificate already installed in the trusted root store of the client. |
true
.