Answers for "Failed to connect to localhost:1433 - self signed certificate"

SQL
0

Failed to connect to localhost:1433 - self signed certificate

const config = {
  port: parseInt(process.env.DB_PORT, 10),
  server: process.env.DB_HOST,
  user: process.env.DB_USER,
  password: process.env.DB_PASS,
  database: process.env.DB_Database,
  stream: false,
  options: {
    trustedConnection: true,
    encrypt: true,
    enableArithAbort: true,
    trustServerCertificate: false,

  },
}

sql.connect(config).then(pool => {
  if (pool.connecting) {
    console.log('Connecting to the database...')
  }
  if (pool.connected) {
    console.log('Connected to SQL Server')
  }
})
Posted by: Guest on August-03-2021

Code answers related to "Failed to connect to localhost:1433 - self signed certificate"

Code answers related to "SQL"

Browse Popular Code Answers by Language