1
0
Fork 0
mirror of synced 2024-07-04 05:50:57 +12:00

Only enable trust server certificate if encryption enabled.

This commit is contained in:
mike12345567 2023-06-29 15:23:08 +01:00 committed by Adria Navarro
parent 7b6246ee59
commit 63d16f1809

View file

@ -184,15 +184,18 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
async connect() {
try {
const encrypt = this.config.encrypt
const clientCfg: MSSQLConfig & sqlServer.config = {
...this.config,
port: +this.config.port,
options: {
encrypt: this.config.encrypt,
encrypt: encrypt,
enableArithAbort: true,
trustServerCertificate: true,
},
}
if (encrypt) {
clientCfg.options!.trustServerCertificate = true
}
delete clientCfg.encrypt
if (this.config.authType === MSSQLConfigAuthType.ACTIVE_DIRECTORY) {