We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f74239 commit da2bae7Copy full SHA for da2bae7
packages/pg/script/create-test-tables.js
@@ -31,13 +31,31 @@ var people = [
31
{ name: 'Zanzabar', age: 260 },
32
]
33
34
-var con = new pg.Client({
+var config = {
35
host: args.host,
36
port: args.port,
37
user: args.user,
38
password: args.password,
39
database: args.database,
40
-})
+}
41
+
42
+if (process.env.PGSSLMODE) {
43
+ config.ssl = {}
44
45
+ if (process.env.PGSSLROOTCERT) {
46
+ config.ssl.ca = fs.readFileSync(process.env.PGSSLROOTCERT)
47
+ }
48
49
+ if (process.env.PGSSLCERT) {
50
+ config.ssl.cert = fs.readFileSync(process.env.PGSSLCERT)
51
52
53
+ if (process.env.PGSSLKEY) {
54
+ config.ssl.key = fs.readFileSync(process.env.PGSSLKEY)
55
56
57
58
+var con = new pg.Client(config)
59
60
con.connect((err) => {
61
if (err) {
0 commit comments