Repository navigation
[8.0.1 Cherry-pick] Connection: Apply ServerCertificate validation to login-only TLS - #5182
Open
github-actions[bot] wants to merge 2 commits into
Open
github-actions[bot] wants to merge 2 commits into
github-actions[bot] wants to merge 2 commits into
Conversation
When ServerCertificate is configured and TrustServerCertificate is false, validate the server certificate for login-only TLS negotiated with Encrypt=Optional, before login is sent. A configured certificate with no negotiated TLS now fails instead of being ignored. Matching certificates, TrustServerCertificate and connections without ServerCertificate are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
paulmedynski
previously approved these changes
Dec 4, 2026
paulmedynski
enabled auto-merge (squash)
December 4, 2026 13:35
Contributor
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
SqlException.EncryptionInfo and SqlServerCertificateValidationErrors are not available on release/8.0. The remaining assertions (fatal error class, single pre-login, no LOGIN7) still verify that a mismatched pin is rejected before login. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
paulmedynski
approved these changes
Dec 4, 2026
Contributor
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/8.0 #5182 +/- ##
===============================================
+ Coverage 70.41% 70.50% +0.09%
===============================================
Files 313 313
Lines 45808 69774 +23966
===============================================
+ Hits 32255 49194 +16939
- Misses 13553 20580 +7027
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #5164 (34ee446) into
release/8.0.The product change applied cleanly. One follow-up commit fixes the new tests' build on this branch.
Additional change: certificate test adaptation
SqlConnectionCertificateTestsusedSqlException.EncryptionInfoandSqlServerCertificateValidationErrors, which come from main-only connection-encryption-info work. Removed those two assertions. The remaining assertions still verify that a mismatched pin is rejected before login: fatal error class 20, one pre-login, and zero LOGIN7 packets.release/8.0already has the required simulated-server test infrastructure.Testing
dotnet build build.proj -t:BuildSqlClient— passed. The unit test project builds.dotnet test src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj -f net10.0 --filter "FullyQualifiedName~SqlConnectionCertificateTests&category!=failing"— 42/42 passed in each of 2 runs. These tests are .NET-only (#if NET), as onmain.