Assert certificate error

This commit is contained in:
Kevin Sawicki 2017-02-07 15:39:18 -08:00
parent 6b56dfd94b
commit 9c134e7bf3

View file

@ -558,6 +558,7 @@ describe('session module', function () {
it('accepts the request when the callback is called with true', function (done) {
session.defaultSession.setCertificateVerifyProc(function (hostname, certificate, error, callback) {
assert.equal(error, 'net::ERR_CERT_AUTHORITY_INVALID')
callback(0)
})
@ -580,6 +581,7 @@ describe('session module', function () {
assert.equal(certificate.issuerCert.issuerCert.issuer.commonName, 'Root CA')
assert.equal(certificate.issuerCert.issuerCert.subject.commonName, 'Root CA')
assert.equal(certificate.issuerCert.issuerCert.issuerCert, undefined)
assert.equal(error, 'net::ERR_CERT_AUTHORITY_INVALID')
callback(-2)
})