ASL-19 / civicdr-backend

GNU General Public License v3.0
0 stars 1 forks source link

Have backend require SSL #31

Closed seamustuohy closed 7 years ago

seamustuohy commented 7 years ago

Currently the postgresql instance we are using does not require SSL to connect to the DB. This is likely because there are issues with a knexfile parsing SSL requirements from a connection passed as a string. There are a couple of ways we can possibly address this.

  1. We can break the knexfile connection definition out into its individual components.

knexfile.js

connection: {
  host: "host",
  port: "port",
  user: "user",
  password: "password",
  database: "database",
  ssl: true
 }
  1. We can set the pg default to be ssl enabled before we define our db.

db/index.js

var pg = require('pg');
pg.defaults.ssl = true;

const db = require('knex')(config);
seamustuohy commented 7 years ago

Addressed in https://github.com/ASL-19/civicdr-backend/pull/36