Skip to content
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

MDS on Linux sends SPN with instance name instead of port #2187

Closed
David-Engel opened this issue Oct 17, 2023 · 1 comment · Fixed by #2240
Closed

MDS on Linux sends SPN with instance name instead of port #2187

David-Engel opened this issue Oct 17, 2023 · 1 comment · Fixed by #2240
Labels
🐛 Bug! Issues that are bugs in the drivers we maintain.

Comments

@David-Engel
Copy link
Contributor

Describe the bug

MDS' managed SNI implementation is sending the SPN in the format MSSQLSVC/SERVERNAME.FQDN:INSTANCENAME instead of MSSQLSVC/SERVERNAME.FQDN:PORT when making TCP connections to named instances.

To reproduce

Connect to a named instance via TCP, managed SNI, and Kerberos auth. Using a network capture, you can see MDS gets a ticket using the named instance instead of the port number.

Expected behavior

MDS should use the MSSQLSVC/SERVERNAME.FQDN:PORT format for consistency with other drivers and aligning with the docs:

User-specified SPNs are supported in client drivers. However, if an SPN isn't provided, it is generated automatically based on the type of a client connection. For a TCP connection, an SPN in the format MSSQLSvc/FQDN:[<port>] is used for both the named and default instances.

For named pipes and shared memory connections, an SPN in the format MSSQLSvc/<FQDN>:<instancename> is used for a named instance and MSSQLSvc/<FQDN> is used for the default instance.

Further technical details

Microsoft.Data.SqlClient version: latest 5.1.1
.NET target: .NET (non Framework)
SQL Server version: All
Operating system: Linux (or managed SNI on Windows)

@David-Engel David-Engel added the 🐛 Bug! Issues that are bugs in the drivers we maintain. label Oct 17, 2023
@David-Engel
Copy link
Contributor Author

Filing this from an internal issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug! Issues that are bugs in the drivers we maintain.
Projects
2 participants