Skip to content

Commit 73875c9

Browse files
authored
Addressing HostNameInCertificate changes in native SNI (#1680)
1 parent 53b9f0a commit 73875c9

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Interop/SNINativeMethodWrapper.Windows.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Microsoft.Data.Common;
6-
using Microsoft.Data.SqlClient;
75
using System;
86
using System.Runtime.InteropServices;
97
using System.Text;
8+
using Microsoft.Data.Common;
9+
using Microsoft.Data.SqlClient;
1010

1111
namespace Microsoft.Data.SqlClient
1212
{
@@ -57,6 +57,8 @@ internal struct AuthProviderInfo
5757
public bool certHash;
5858
public object clientCertificateCallbackContext;
5959
public SqlClientCertificateDelegate clientCertificateCallback;
60+
[MarshalAs(UnmanagedType.LPWStr)]
61+
public string serverCertFileName;
6062
};
6163

6264

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeMethodWrapper.cs

+2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ internal struct AuthProviderInfo
182182
public bool certHash;
183183
public object clientCertificateCallbackContext;
184184
public SqlClientCertificateDelegate clientCertificateCallback;
185+
[MarshalAs(UnmanagedType.LPWStr)]
186+
public string serverCertFileName;
185187
};
186188

187189
internal struct CTAIPProviderInfo

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

+1
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,7 @@ private void EnableSsl(uint info, SqlConnectionEncryptOption encrypt, bool integ
11951195
authInfo.certHash = false;
11961196
authInfo.clientCertificateCallbackContext = IntPtr.Zero;
11971197
authInfo.clientCertificateCallback = null;
1198+
authInfo.serverCertFileName = null;
11981199

11991200
if ((_encryptionOption & EncryptionOptions.CLIENT_CERT) != 0)
12001201
{

tools/props/Versions.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</PropertyGroup>
2121
<!-- NetFx project dependencies -->
2222
<PropertyGroup>
23-
<MicrosoftDataSqlClientSniVersion>5.0.0-preview3.22165.1</MicrosoftDataSqlClientSniVersion>
23+
<MicrosoftDataSqlClientSniVersion>5.0.0</MicrosoftDataSqlClientSniVersion>
2424
<SystemSecurityCryptographyAlgorithmsVersion>4.3.1</SystemSecurityCryptographyAlgorithmsVersion>
2525
<SystemSecurityCryptographyPrimitivesVersion>4.3.0</SystemSecurityCryptographyPrimitivesVersion>
2626
</PropertyGroup>
@@ -38,7 +38,7 @@
3838
<!-- NetCore project dependencies -->
3939
<PropertyGroup>
4040
<MicrosoftWin32RegistryVersion>5.0.0</MicrosoftWin32RegistryVersion>
41-
<MicrosoftDataSqlClientSNIRuntimeVersion>5.0.0-preview3.22165.1</MicrosoftDataSqlClientSNIRuntimeVersion>
41+
<MicrosoftDataSqlClientSNIRuntimeVersion>5.0.0</MicrosoftDataSqlClientSNIRuntimeVersion>
4242
<SystemConfigurationConfigurationManagerVersion>5.0.0</SystemConfigurationConfigurationManagerVersion>
4343
<MicrosoftSqlServerServerVersion>1.0.0</MicrosoftSqlServerServerVersion>
4444
<SystemDiagnosticsDiagnosticSourceVersion>5.0.0</SystemDiagnosticsDiagnosticSourceVersion>

tools/specs/Microsoft.Data.SqlClient.nuspec

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ When using NuGet 3.x this package requires at least version 3.4.</description>
2828
<tags>sqlclient microsoft.data.sqlclient</tags>
2929
<dependencies>
3030
<group targetFramework="net462">
31-
<dependency id="Microsoft.Data.SqlClient.SNI" version="5.0.0-preview3.22165.1" />
31+
<dependency id="Microsoft.Data.SqlClient.SNI" version="5.0.0" />
3232
<dependency id="Azure.Identity" version="1.6.0" />
3333
<dependency id="Microsoft.Identity.Client" version="4.45.0" />
3434
<dependency id="Microsoft.IdentityModel.JsonWebTokens" version="6.21.0" />
@@ -42,7 +42,7 @@ When using NuGet 3.x this package requires at least version 3.4.</description>
4242
<dependency id="System.Text.Encodings.Web" version="4.7.2" />
4343
</group>
4444
<group targetFramework="netcoreapp3.1">
45-
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="5.0.0-preview3.22165.1" exclude="Compile" />
45+
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="5.0.0" exclude="Compile" />
4646
<dependency id="Azure.Identity" version="1.6.0" />
4747
<dependency id="Microsoft.Identity.Client" version="4.45.0" exclude="Compile"/>
4848
<dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.21.0" />
@@ -61,7 +61,7 @@ When using NuGet 3.x this package requires at least version 3.4.</description>
6161
<dependency id="System.Security.Principal.Windows" version="5.0.0" exclude="Compile" />
6262
</group>
6363
<group targetFramework="netstandard2.0">
64-
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="5.0.0-preview3.22165.1" exclude="Compile" />
64+
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="5.0.0" exclude="Compile" />
6565
<dependency id="Azure.Identity" version="1.6.0" />
6666
<dependency id="Microsoft.Identity.Client" version="4.45.0" exclude="Compile"/>
6767
<dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.21.0" />
@@ -80,7 +80,7 @@ When using NuGet 3.x this package requires at least version 3.4.</description>
8080
<dependency id="System.Security.Principal.Windows" version="5.0.0" exclude="Compile" />
8181
</group>
8282
<group targetFramework="netstandard2.1">
83-
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="5.0.0-preview3.22165.1" exclude="Compile" />
83+
<dependency id="Microsoft.Data.SqlClient.SNI.runtime" version="5.0.0" exclude="Compile" />
8484
<dependency id="Azure.Identity" version="1.6.0" />
8585
<dependency id="Microsoft.Identity.Client" version="4.45.0" exclude="Compile"/>
8686
<dependency id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.21.0" />

0 commit comments

Comments
 (0)