I'm trying to run sequelize-cli, specifically npx sequelize db:migrate
.
I've created a config file in config/config.js
which looks like this (obviously with correct credentials):
module.exports = {
development: {
username: "USER",
password: "PASSWORD",
database: "DB_NAME",
host: "HOST.net",
dialect: 'mssql',
dialectOptions: {
encrypt: "true" // bool - true - doesn't work either
}
}
};
However I'm receiving the following error:
ERROR: Server requires encryption, set 'encrypt' config option to true.
As you can see from my config I believe I have set encrypt to true. This is my understanding of how to set this option from the docs.
How can I successfully set encrypt
to true?
How to configure SSL encryption in SQL Server 1 Install the SQL Server certificate using Microsoft Management Console. ... 2 Configuring SQL Server to accept encrypted connections. ... 3 Configuring the SQL Server clients to use encrypted connections. ... 4 SSL encryption for failover clustering in SQL Server. ...
To use the migration feature, you need to install the Sequelize CLI tool named sequelize-cli. You can install it on your computer using NPM or Yarn. Because the CLI tool is used from the command line, you need to install it globally: Alternatively, you can also use the npx command to run sequelize-cli without installing it globally:
In the SQL Server Configuration Manager right-click SQL Server Native Client Configuration, and then click Properties. On the Flags tab, select Yes in the ForceEncryption box, then click OK.
Packets sent from the application to the instance of SQL Server must be encrypted by the client TLS stack and decrypted by the server TLS stack. Packets sent from the instance of SQL Server to the application must be encrypted by the server TLS stack and decrypted by the client TLS stack.
This should fix the issue,
module.exports = {
development: {
username: "USER",
password: "PASSWORD",
database: "DB_NAME",
host: "HOST.net",
dialect: 'mssql',
dialectOptions: {
options: {
encrypt: true
}
}
}
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With