Load TrustServerCertificate value from connection settings when running integration tests. (#2074)

This commit is contained in:
Cory Rivera
2023-05-22 17:18:19 -07:00
committed by GitHub
parent c59211b31b
commit 97988661ec
2 changed files with 9 additions and 0 deletions

View File

@@ -66,6 +66,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string? HostNameInCertificate { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string? TrustServerCertificate { get; set; }
public TestServerType ServerType { get; set; }
public AuthenticationType AuthenticationType { get; set; }

View File

@@ -195,6 +195,12 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
connectParams.Connection.DatabaseName = databaseName;
connectParams.Connection.DatabaseDisplayName = databaseName;
}
if (!string.IsNullOrEmpty(connectionProfile.TrustServerCertificate))
{
connectParams.Connection.TrustServerCertificate = bool.Parse(connectionProfile.TrustServerCertificate);
}
if (key == SqlAzureInstanceKey || key == SqlAzureInstanceKey)
{
connectParams.Connection.ConnectTimeout = 30;