Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Backports PR #3929 to release/6.1, adjusting native SNI connection setup so SPN generation is only triggered for integrated security, avoiding unnecessary DNS/SPN work for non-integrated auth modes (e.g., SQL auth) on Windows native SNI.
Changes:
- Normalize
serverSPNbased on authentication mode before calling into native SNI (empty string only used to trigger SPN generation for integrated security; otherwise avoid generation). - Adjust
resolvedSpncreation to only occur when a non-empty SPN is present after native SNI setup. - Add a unit test intended to validate SPN normalization behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs | Introduces SPN normalization helper and updates native handle creation logic to avoid unintended SPN generation for non-integrated auth. |
| src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/TdsParserStateObjectNativeTests.cs | Adds a unit test for SPN normalization logic (currently gated in a way that likely prevents it from compiling/running). |
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs
Show resolved
Hide resolved
...t.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/TdsParserStateObjectNativeTests.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs
Show resolved
Hide resolved
priyankatiwari08
approved these changes
Feb 12, 2026
paulmedynski
approved these changes
Feb 12, 2026
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.
Description
Ports #3929 to release/6.1
Issues
Fixes #3941
Testing
Issue impacted only the netcore app and not the netfx app.
Added unit test to validate the code changes.
E2E Validation using the repro provided in #3523 and env setup as mentioned in #3929
Without the fix
With the fix
Guidelines
Please review the contribution guidelines before submitting a pull request: