-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add "Encrypt=false" to SQL Server connectionString sample #13792
Conversation
I don't think this is a good idea as it may encourage bad practice for production. The same string should not include this parameter. Maybe we should find a way to show a warning on the screen if the connection failed due to the security issue instead |
Why it's bad practice, it's just a sample nothing more, but anyone can immediately recognize that he SHOULD pass the
If this parameter not supplied the validator will show the message, there's already a bug that the author spent hours to figure out that he should add the new parameter |
I think it’s a bad idea because some users may start copying/pasting the sample without paying much attention. A warning if the connection fails due to security sounds like a better idea to me. |
I understand what you mean, believe me, or not I spent several minutes to figure out this, don't forget when you submit the page a validator will show a message and probably you want to show another warning and enter both the connection string and password again which is time-consuming Again what we provide is just a sample nothing more, so let us hear the folks feedback and I'm open to any suggestion :) |
What about changing the hint text to explain this might be necessary to set this attribute? |
We could, but by adding it to the hint we required the user to copy the property and set it within the connection string with the specified value. It would be nice if it's one step, change the |
@hishamco Don't add the Encrypt=false to the connection string. Add something that explains about the Encrypt param in the hint .cshtml file.
|
Just a reminder about why issues happen with Microsoft.Data.SqlClient:
So by default encryption is enabled, and the driver will always validate the server certificate. Locally you won't have a valid certificate, to either set This text in the doc might be sufficient, and a link to the doc in the hint. Also a better exception message when the connection is created and fails from the expected exception (I thought we had done that already). |
@sebastienros can you share the link to that documentation. I tried finding it without success earlier. |
@Skrypt I think @sebastienros was referring to https://docs.orchardcore.net/en/latest/docs/releases/1.5.0/#yessql-breaking-changes Also, if you look at the logs you'll get explanation. But I think in this case, we should catch this special exception in the DatabaseValidation class and when this issue occur, we should print out a hit using notification so the use know what to do. |
I'm with the others above; don't encourage lack of security in a sample without further explanation. |
I think this is the official doc for the topic. https://learn.microsoft.com/en-us/sql/connect/ado-net/encryption-and-certificate-validation?view=sql-server-ver16 I found the blurb I pasted in the release changelog of the library. |
@MikeAlhayek should I close this after your PR #15210? |
yes. I am closing it. |
Many of us are facing an issue when they supply SQL Server connectionString, more specifically after the SQL Server uses the secure connection. I knew it's documented but it's good to show it in the setup screen instead of spending minutes or hour to figure out why the connection valid
Fixes #15201