Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8b94f70

Browse files
committedApr 16, 2020
supporting whitelisted ssl certificate domain handling
1 parent 098d347 commit 8b94f70

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed
 

‎dist/node-socket.js

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/node-socket.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ export default class TCPSocket {
1919
throw new Error('Only arraybuffers are supported!')
2020
}
2121

22+
var connectOptions = {
23+
port: this.port,
24+
host: this.host,
25+
servername: this.host // SNI
26+
}
27+
28+
if (global.checkImapServerIdentity) {
29+
connectOptions.checkServerIdentity = global.checkImapServerIdentity
30+
}
31+
2232
this._socket = this.ssl
23-
? tls.connect({
24-
port: this.port,
25-
host: this.host,
26-
servername: this.host // SNI
27-
}, () => this._emit('open'))
33+
? tls.connect(connectOptions, () => this._emit('open'))
2834
: net.connect(this.port, this.host, () => this._emit('open'))
2935

3036
// add all event listeners to the new socket

0 commit comments

Comments
 (0)
Please sign in to comment.