Skip to content

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

@David-Engel

Description

@David-Engel

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions