Skip to content

Port #3929 to release/6.1#3946

Open
apoorvdeshmukh wants to merge 1 commit intorelease/6.1from
dev/ad/port3929to61
Open

Port #3929 to release/6.1#3946
apoorvdeshmukh wants to merge 1 commit intorelease/6.1from
dev/ad/port3929to61

Conversation

@apoorvdeshmukh
Copy link
Contributor

@apoorvdeshmukh apoorvdeshmukh commented Feb 10, 2026

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

Data Source=tcp:XXXXXX,XXXX;Initial Catalog=Demo2;User ID=XX;Password=XXXXXXXX;Connect Timeout=10;Encrypt=True;Trust Server Certificate=True;Application Name="Connection test"
Connection successful!
Time taken to connect: 5185 ms ms

With the fix

Data Source=tcp:XXXXXX,XXXX;Initial Catalog=Demo2;User ID=XX;Password=XXXXXXXX;Connect Timeout=10;Encrypt=True;Trust Server Certificate=True;Application Name="Connection test"
Connection successful!
Time taken to connect: 263 ms

Guidelines

Please review the contribution guidelines before submitting a pull request:

@apoorvdeshmukh apoorvdeshmukh requested a review from a team as a code owner February 10, 2026 15:35
Copilot AI review requested due to automatic review settings February 10, 2026 15:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 serverSPN based on authentication mode before calling into native SNI (empty string only used to trigger SPN generation for integrated security; otherwise avoid generation).
  • Adjust resolvedSpn creation 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).

@priyankatiwari08 priyankatiwari08 self-assigned this Feb 12, 2026
@paulmedynski paulmedynski self-assigned this Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants