failed to connect to localhost 3a1433 self signed certificate

Solutions on MaxInterview for failed to connect to localhost 3a1433 self signed certificate by the best coders in the world

showing results for - "failed to connect to localhost 3a1433 self signed certificate"
Charlotte
22 Aug 2020
1const config = {
2  port: parseInt(process.env.DB_PORT, 10),
3  server: process.env.DB_HOST,
4  user: process.env.DB_USER,
5  password: process.env.DB_PASS,
6  database: process.env.DB_Database,
7  stream: false,
8  options: {
9    trustedConnection: true,
10    encrypt: true,
11    enableArithAbort: true,
12    trustServerCertificate: false,
13
14  },
15}
16
17sql.connect(config).then(pool => {
18  if (pool.connecting) {
19    console.log('Connecting to the database...')
20  }
21  if (pool.connected) {
22    console.log('Connected to SQL Server')
23  }
24})
25