title: Certificate error when connecting to SQL Server
body: <p>When trying to connect to SQL Server, I get the following error:</p>
  
  <blockquote>
    <p>(node:9364) UnhandledPromiseRejectionWarning: ConnectionError: Failed to connect to 10.120.6.11:1433 - self signed certificate</p>
  </blockquote>
  
  <p>When I use SQL Server 2014, it works normally.</p>
  
  <p>Note: You need a vpn to connect.</p>
  
  <p>Code:</p>
  
  <pre><code>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 =&gt; {
    if (pool.connecting) {
      console.log('Connecting to the database...')
    }
    if (pool.connected) {
      console.log('Connected to SQL Server')
    }
  })
  </code></pre>