Use object for verification request

This commit is contained in:
Kevin Sawicki 2017-02-07 16:35:37 -08:00
parent 5245d42d15
commit 70178adb6e
7 changed files with 52 additions and 18 deletions

View file

@ -22,9 +22,9 @@ Session.prototype._init = function () {
}
Session.prototype.setCertificateVerifyProc = function (verifyProc) {
if (verifyProc != null && verifyProc.length <= 3) {
if (verifyProc != null && verifyProc.length > 2) {
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings
this._setCertificateVerifyProc((hostname, certificate, error, cb) => {
this._setCertificateVerifyProc(({hostname, certificate, verificationResult}, cb) => {
verifyProc(hostname, certificate, (result) => {
cb(result ? 0 : -2)
})