From 2f4cbe9998a0690bbeceedf35600a48cfb99516e Mon Sep 17 00:00:00 2001 From: Brian C Date: Sun, 10 Jul 2016 16:28:03 -0500 Subject: [PATCH] Created SSL support (markdown) --- SSL-support.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 SSL-support.md diff --git a/SSL-support.md b/SSL-support.md new file mode 100644 index 0000000..c2a5ec6 --- /dev/null +++ b/SSL-support.md @@ -0,0 +1,23 @@ + +### connect to self signed Postgresql server + +Use following config to connect a Postgresql Server self signed: + +``` +var config = { + database : 'database-name', //env var: PGDATABASE + host : "host-or-ip", //env var: PGPORT + port : 5432, //env var: PGPORT + max : 100, // max number of clients in the pool + idleTimeoutMillis: 30000, + ssl : { + rejectUnauthorized : false, + ca : fs.readFileSync("/path/to/server-certificates/maybe/root.crt").toString(), + key : fs.readFileSync("/path/to/client-key/maybe/postgresql.key").toString(), + cert : fs.readFileSync("/path/to/client-certificates/maybe/postgresql.crt").toString(), + } +}; + +``` + +For more information about `config.ssl` check [TLS (SSL) of nodejs](https://nodejs.org/dist/latest-v4.x/docs/api/tls.html) \ No newline at end of file