zorgo
zorgo

Reputation: 43

Problem with connect by Sequelize when I connect to SQL Server

I use the mssql package and connect to database like this:

const sql = require('mssql')
const config = {
    user: 'sa',
    password: 'xxxxxx',
    server: 'xxx.xxx.xxx.xxx',
    database: 'zorgo',
    options : {
        enableArithAbort: false,
        cryptoCredentialsDetails: {
            minVersion: 'TLSv1'
        }
    }
};

Now I want to try 'sequelize' library and try to connect

const sequelize = new Sequelize('zorgo', 'sa', 'xxxxxx', {
    dialect: 'mssql',
    host: 'xxx.xxx.xxx.xxx',
    options: {
        enableArithAbort: false,
        cryptoCredentialsDetails: {
            minVersion: 'TLSv1'
        }
    }
});

But I get an error

Failed to connect to xxx.xxx.xxx.xxx:1433 - 584:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol

Please help me resolve this problem

Upvotes: 0

Views: 1271

Answers (1)

zorgo
zorgo

Reputation: 43

I found the answer to my question

    const sequelize = new Sequelize('zorgo', 'sa', 'xxxxxx', {
    dialect: 'mssql',
    host: 'xxx.xxx.xxx.xxx',
    dialectOptions: {
        options: {
            enableArithAbort: false,
            cryptoCredentialsDetails: {
                minVersion: 'TLSv1'
            }
        }
    }
});

And works well...

Upvotes: 1

Related Questions