Use SSL automatically for Azure SQL

This commit is contained in:
SPRINX0\prochazka
2025-11-10 11:57:46 +01:00
parent 7ad3fc4751
commit 4b6b74604b

View File

@@ -69,7 +69,11 @@ async function tediousConnect(storedConnection) {
const [host, instance] = (server || '').split('\\');
const connectionOptions = {
instanceName: instance,
encrypt: !!ssl || authType == 'msentra' || authType == 'azureManagedIdentity',
encrypt:
!!ssl ||
authType == 'msentra' ||
authType == 'azureManagedIdentity' ||
server?.endsWith('.database.windows.net'),
cryptoCredentialsDetails: ssl ? _.pick(ssl, ['ca', 'cert', 'key']) : undefined,
trustServerCertificate: ssl ? (!ssl.ca && !ssl.cert && !ssl.key ? true : ssl.rejectUnauthorized) : undefined,
enableArithAbort: true,