Skip to content

Commit

Permalink
add a "trust server certificate" checkbox to allow using self-signed …
Browse files Browse the repository at this point in the history
…certs (#164)
  • Loading branch information
mikeblas authored Oct 9, 2024
1 parent 7f338a3 commit 42d8ed4
Show file tree
Hide file tree
Showing 5 changed files with 617 additions and 537 deletions.
5 changes: 4 additions & 1 deletion src/SQLQueryStress/ConnectionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public class ConnectionInfo : ICloneable
[DataMember]
public string EncryptOption { get; set; }

[DataMember]
public bool TrustServerCertificate { get; set; }

[IgnoreDataMember]
public SqlConnectionEncryptOption Encrypt
{
Expand Down Expand Up @@ -98,7 +101,7 @@ public string ConnectionString
{
get
{
var build = new SqlConnectionStringBuilder { DataSource = Server, IntegratedSecurity = IntegratedAuth, ApplicationName = "SQLQueryStress", ApplicationIntent = ApplicationIntent };
var build = new SqlConnectionStringBuilder { DataSource = Server, IntegratedSecurity = IntegratedAuth, ApplicationName = "SQLQueryStress", ApplicationIntent = ApplicationIntent, TrustServerCertificate = TrustServerCertificate };
if (!IntegratedAuth && !AzureMFA)
{
build.UserID = Login;
Expand Down
Loading

0 comments on commit 42d8ed4

Please sign in to comment.