Skip to content

Commit 21a4311

Browse files
committed
reorder
1 parent 4ae807b commit 21a4311

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,6 @@ internal void Connect(
468468
hostNameInCertificate,
469469
serverCertificateFilename);
470470

471-
_authenticationProvider?.Initialize(serverInfo, _physicalStateObj, this, _sniSpn);
472-
473471
if (TdsEnums.SNI_SUCCESS != _physicalStateObj.Status)
474472
{
475473
_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj));
@@ -484,6 +482,8 @@ internal void Connect(
484482
Debug.Fail("SNI returned status != success, but no error thrown?");
485483
}
486484

485+
_authenticationProvider?.Initialize(serverInfo, _physicalStateObj, this, _sniSpn);
486+
487487
_server = serverInfo.ResolvedServerName;
488488

489489
if (null != connHandler.PoolGroupProviderInfo)

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,6 @@ internal void Connect(ServerInfo serverInfo,
648648
FQDNforDNSCache,
649649
hostNameInCertificate);
650650

651-
_authenticationProvider?.Initialize(serverInfo, _physicalStateObj, this, _sniSpn);
652-
653651
if (TdsEnums.SNI_SUCCESS != _physicalStateObj.Status)
654652
{
655653
_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj));
@@ -664,6 +662,8 @@ internal void Connect(ServerInfo serverInfo,
664662
Debug.Fail("SNI returned status != success, but no error thrown?");
665663
}
666664

665+
_authenticationProvider?.Initialize(serverInfo, _physicalStateObj, this, _sniSpn);
666+
667667
_server = serverInfo.ResolvedServerName;
668668

669669
if (null != connHandler.PoolGroupProviderInfo)

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/SSPIContextProvider.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ internal abstract class SSPIContextProvider
1717

1818
internal void Initialize(ServerInfo serverInfo, TdsParserStateObject physicalStateObj, TdsParser parser, params string[] serverNames)
1919
{
20+
if (serverNames is null)
21+
{
22+
throw new ArgumentNullException(nameof(serverNames));
23+
}
24+
2025
Debug.Assert(serverNames.Length > 0);
2126

2227
_parser = parser;
@@ -29,7 +34,7 @@ internal void Initialize(ServerInfo serverInfo, TdsParserStateObject physicalSta
2934
Initialize();
3035
}
3136

32-
private SqlAuthenticationParameters InitializeAuthenticationParameters(SqlInternalConnectionTds connection, string serverName)
37+
private static SqlAuthenticationParameters InitializeAuthenticationParameters(SqlInternalConnectionTds connection, string serverName)
3338
{
3439
var auth = new SqlAuthenticationParameters.Builder(
3540
authenticationMethod: connection.ConnectionOptions.Authentication,

0 commit comments

Comments
 (0)