Skip to content

Commit dd2d4af

Browse files
Fix SPN generation issue when no port is provided (#629)
1 parent 028041f commit dd2d4af

File tree

1 file changed

+4
-0
lines changed
  • src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI

1 file changed

+4
-0
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ private static byte[] GetSqlServerSPN(string hostNameOrAddress, string portOrIns
365365
{
366366
serverSpn += ":" + portOrInstanceName;
367367
}
368+
else
369+
{
370+
serverSpn += $":{DefaultSqlServerPort}";
371+
}
368372
return Encoding.UTF8.GetBytes(serverSpn);
369373
}
370374

0 commit comments

Comments
 (0)