title: After migrating from Monggose 5.x to 6.x facing connectivity issues
body: <p>I am migrating the mongoose from 5.x to 6.x, using createConnection method and updated the options as suggested in mongoose official site.
  Trying to connect through the SSL certificate validation and X.509 authentication.</p>
  <p>Getting the below error:</p>
  <pre><code>Connected SuccessFully 2
  API is running securely on the PORT: 3123
  Error connecting to Mongo Database.
  MongooseServerSelectionError: unable to get local issuer certificate
      at NativeConnection.Connection.openUri (/opt/connect/service/node_modules/mongoose/lib/connection.js:824:32)
      at Mongoose.createConnection (/opt/connect/service/node_modules/mongoose/lib/index.js:326:10)
      at TestSetupConnection.setupConnection (/opt/connect/service/classtestmongoose.js:29:41)
      at /opt/connect/service/app.js:30:60
      at propagateAslWrapper (/opt/connect/service/node_modules/async-listener/index.js:504:23)
      at /opt/connect/service/node_modules/async-listener/index.js:541:70
      at /opt/connect/service/node_modules/async-listener/glue.js:188:31
      at processTicksAndRejections (internal/process/task_queues.js:93:5) {
    reason: TopologyDescription {
      type: 'ReplicaSetNoPrimary',
      servers: Map(3) {
        'pl-1-us-east-1.5ylwo.mongodb.net:1025' =&gt; [ServerDescription],
        'pl-1-us-east-1.5ylwo.mongodb.net:1026' =&gt; [ServerDescription],
        'pl-1-us-east-1.5ylwo.mongodb.net:1024' =&gt; [ServerDescription]
      },
      stale: false,
      compatible: true,
      heartbeatFrequencyMS: 10000,
      localThresholdMS: 15,
      setName: 'atlas-24xeac-shard-3',
      logicalSessionTimeoutMinutes: undefined
    },
    code: undefined
  }
  </code></pre>