title: node:10212[DEP0123]DeprecationWarning:Setting the TLS ServerName to an IPaddress is not permitted by RFC 6066.This will be ignored in a future version
body: <p>Below is my nodejs code to connect to a mssql database and query data</p>
  <pre><code>const sql = require('mssql')
  export class GetJDBCCasedata {
    async fetchData(wellid, wellboreid, designid) {
      var result
       console.log(&quot;In fetchdata&quot;)
  const sqlConfig = {
    user: 'root',
    password:'root',
    database: 'student',
    server: '12.11.234.12',
   /* pool: {
      max: 10,
      min: 0,
      idleTimeoutMillis: 30000
    },*/
    options: {
      encrypt: true,
      trustServerCertificate: true,
    }
  }
  console.log(&quot;CONFIG FOR SERVER &quot;+JSON.stringify(sqlConfig))
   try {
    console.log(&quot;Connecting to database&quot;)
    result=await sql.connect(sqlConfig)
    console.log(&quot;Connected to database&quot;)
   } catch (err) {
    result=err
    console.log(&quot;ERROR OCCURRED &quot;+err)
   }
  return result
    }
  }
  </code></pre>
  <p>The code runs fine and I get the message as &quot;Connected to database&quot;. However I get a message as &quot;(node:10212) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.&quot; What can I do to get rid of it?</p>