Only enable trust server certificate if encryption enabled.
This commit is contained in:
parent
7b6246ee59
commit
63d16f1809
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue