Skip to content

Commit 631a67d

Browse files
committed
Forward options’ ssl.key even when non-enumerable
1 parent b18e725 commit 631a67d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Diff for: packages/pg/lib/connection.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,18 @@ class Connection extends EventEmitter {
7676
return self.emit('error', new Error('There was an error establishing an SSL connection'))
7777
}
7878
var tls = require('tls')
79-
const options = Object.assign(
80-
{
81-
socket: self.stream,
82-
},
83-
self.ssl
84-
)
79+
const options = {
80+
socket: self.stream,
81+
}
82+
83+
if (self.ssl !== true) {
84+
Object.assign(options, self.ssl)
85+
86+
if ('key' in self.ssl) {
87+
options.key = self.ssl.key
88+
}
89+
}
90+
8591
if (net.isIP(host) === 0) {
8692
options.servername = host
8793
}

0 commit comments

Comments
 (0)