mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-09-20 15:26:03 +08:00
fix(pop3-starttls): ensure default SNICallback option
This commit is contained in:
parent
4b19dee20b
commit
f61111e3cc
|
@ -191,21 +191,17 @@ class POP3Server extends EventEmitter {
|
|||
}
|
||||
|
||||
if (this.options.secure) {
|
||||
// appy changes
|
||||
|
||||
// apply changes
|
||||
Object.keys(defaultTlsOptions || {}).forEach(key => {
|
||||
if (!(key in this.options)) {
|
||||
this.options[key] = defaultTlsOptions[key];
|
||||
}
|
||||
});
|
||||
|
||||
// ensure SNICallback method
|
||||
if (typeof this.options.SNICallback !== 'function') {
|
||||
// create default SNI handler
|
||||
this.options.SNICallback = (servername, cb) => {
|
||||
cb(null, this.secureContext.get(servername));
|
||||
};
|
||||
}
|
||||
} else if (typeof this.options.SNICallback !== 'function') {
|
||||
// create a default SNI handler
|
||||
this.options.SNICallback = (servername, cb) => {
|
||||
cb(null, this.secureContext.get(servername));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue