Skip to content

Commit db478ed

Browse files
[Release 5.0] Fix missing HostNameInCertificate connection string property issue in .NET Framework
1 parent 914caf5 commit db478ed

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,10 @@ public SqlConnectionStringBuilder(string connectionString) { }
10371037
[System.ComponentModel.DisplayNameAttribute("Encrypt")]
10381038
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
10391039
public SqlConnectionEncryptOption Encrypt { get { throw null; } set { } }
1040+
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml' path='docs/members[@name="SqlConnectionStringBuilder"]/HostNameInCertificate/*'/>
1041+
[System.ComponentModel.DisplayNameAttribute("Host Name In Certificate")]
1042+
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]
1043+
public string HostNameInCertificate { get { throw null; } set { } }
10401044
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml' path='docs/members[@name="SqlConnectionStringBuilder"]/Enlist/*'/>
10411045
[System.ComponentModel.DisplayNameAttribute("Enlist")]
10421046
[System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)]

src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlConnectionStringBuilderTest.cs

+11
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,17 @@ public void SetEncryptOnConnectionBuilderMapsToString()
360360
}
361361
}
362362

363+
[Fact]
364+
public void AbleToSetHostNameInCertificate()
365+
{
366+
var testhostname = "somedomain.net";
367+
var builder = new SqlConnectionStringBuilder
368+
{
369+
HostNameInCertificate = testhostname
370+
};
371+
Assert.Equal(testhostname, builder.HostNameInCertificate);
372+
}
373+
363374
[Fact]
364375
public void ConnectionBuilderEncryptBackwardsCompatibility()
365376
{

0 commit comments

Comments
 (0)