We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b18e725 commit 631a67dCopy full SHA for 631a67d
packages/pg/lib/connection.js
@@ -76,12 +76,18 @@ class Connection extends EventEmitter {
76
return self.emit('error', new Error('There was an error establishing an SSL connection'))
77
}
78
var tls = require('tls')
79
- const options = Object.assign(
80
- {
81
- socket: self.stream,
82
- },
83
- self.ssl
84
- )
+ const options = {
+ socket: self.stream,
+ }
+
+ if (self.ssl !== true) {
+ Object.assign(options, self.ssl)
85
86
+ if ('key' in self.ssl) {
87
+ options.key = self.ssl.key
88
89
90
91
if (net.isIP(host) === 0) {
92
options.servername = host
93
0 commit comments