add support for TrustServerCertificate connection string option for SQL Server
This commit is contained in:
@ -48,6 +48,18 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if (_encryption == "true")
|
||||||
|
{
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="trustservercertificate" HelpText="Specify the type of certificate you are using for encryption" ResourceKey="TrustServerCertificate">Certificate:</Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<select id="encryption" class="form-select custom-select" @bind="@_trustservercertificate">
|
||||||
|
<option value="true">@Localizer["Self Signed"]</option>
|
||||||
|
<option value="false">@Localizer["Verifiable"]</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private string _server = String.Empty;
|
private string _server = String.Empty;
|
||||||
@ -56,6 +68,7 @@
|
|||||||
private string _uid = String.Empty;
|
private string _uid = String.Empty;
|
||||||
private string _pwd = String.Empty;
|
private string _pwd = String.Empty;
|
||||||
private string _encryption = "false";
|
private string _encryption = "false";
|
||||||
|
private string _trustservercertificate = "false";
|
||||||
|
|
||||||
public string GetConnectionString()
|
public string GetConnectionString()
|
||||||
{
|
{
|
||||||
@ -75,6 +88,7 @@
|
|||||||
connectionString += $"User ID={_uid};Password={_pwd};";
|
connectionString += $"User ID={_uid};Password={_pwd};";
|
||||||
}
|
}
|
||||||
connectionString += $"Encrypt={_encryption};";
|
connectionString += $"Encrypt={_encryption};";
|
||||||
|
connectionString += $"TrustServerCertificate={_trustservercertificate};";
|
||||||
|
|
||||||
return connectionString;
|
return connectionString;
|
||||||
}
|
}
|
||||||
|
@ -159,4 +159,16 @@
|
|||||||
<data name="Encryption.HelpText" xml:space="preserve">
|
<data name="Encryption.HelpText" xml:space="preserve">
|
||||||
<value>Specify if you are using an encrypted database connection. It is highly recommended to use encryption in a production environment.</value>
|
<value>Specify if you are using an encrypted database connection. It is highly recommended to use encryption in a production environment.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Self Signed" xml:space="preserve">
|
||||||
|
<value>Self Signed</value>
|
||||||
|
</data>
|
||||||
|
<data name="TrustServerCertificate.HelpText" xml:space="preserve">
|
||||||
|
<value>Specify the type of certificate you are using for encryption</value>
|
||||||
|
</data>
|
||||||
|
<data name="TrustServerCertificate.Text" xml:space="preserve">
|
||||||
|
<value>Trust Server Certificate:</value>
|
||||||
|
</data>
|
||||||
|
<data name="Verifiable" xml:space="preserve">
|
||||||
|
<value>Verifiable</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
Reference in New Issue
Block a user