mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-25 16:03:13 +00:00
* Test client certificate authentication * Forward options’ ssl.key even when non-enumerable
24 lines
513 B
JavaScript
24 lines
513 B
JavaScript
'use strict'
|
|
|
|
const fs = require('fs')
|
|
|
|
const helper = require('./test-helper')
|
|
const pg = helper.pg
|
|
|
|
const suite = new helper.Suite()
|
|
|
|
if (process.env.PG_CLIENT_CERT_TEST) {
|
|
suite.testAsync('client certificate', async () => {
|
|
const pool = new pg.Pool({
|
|
ssl: {
|
|
ca: fs.readFileSync(process.env.PGSSLROOTCERT),
|
|
cert: fs.readFileSync(process.env.PGSSLCERT),
|
|
key: fs.readFileSync(process.env.PGSSLKEY),
|
|
},
|
|
})
|
|
|
|
await pool.query('SELECT 1')
|
|
await pool.end()
|
|
})
|
|
}
|