Skip to content

Commit 839a3df

Browse files
authored
Merge pull request emailjs#75 from warp/fix/send-sni-for-node-12-support
Send SNI for node 12 support
2 parents 01ececf + 6e123ce commit 839a3df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/node-socket.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ export default class TCPSocket {
2020
}
2121

2222
this._socket = this.ssl
23-
? tls.connect(this.port, this.host, { }, () => this._emit('open'))
23+
? tls.connect({
24+
port: this.port,
25+
host: this.host,
26+
servername: this.host // SNI
27+
}, () => this._emit('open'))
2428
: net.connect(this.port, this.host, () => this._emit('open'))
2529

2630
// add all event listeners to the new socket

0 commit comments

Comments
 (0)