'Nodejs Snowflake connection - Error [NetworkError]: Network error. Could not reach Snowflake

I am trying to connect snowflake, using the node.js driver found in the snowflake documentation

var snowflake = require('snowflake-sdk');

var connection = snowflake.createConnection({
  account: 'account1',
  username: 'user1',
  password: 'pass1',
  region: 'us-east-1'
});

connection.connect(function(err, conn) {
  if (err) {
    console.error('Unable to connect: ' + err.message);
  } else {
    console.log('Successfully connected as id: ' + connection.getId());
  }
});

Error: Network error. Could not reach Snowflake.

code: 401001,

cause: Error: unable to get local issuer certificate

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source