Commit d9b70f9c authored by Mike Atkins's avatar Mike Atkins Committed by Rod Vagg
Browse files

tls: handle empty cert in checkServerIndentity

This resolves joyent/node#9272. `tlsSocket.getPeerCertificate` will
return an empty object when the peer does not provide a certificate,
but, prior to this, when the certificate is empty, `checkServerIdentity`
would throw because the `subject` wasn't present on the cert.
`checkServerIdentity` must return an error, not throw one, so this
returns an error when the cert is empty instead of throwing
a `TypeError`.

PR-URL: https://github.com/nodejs/node/pull/2343


Reviewed-By: default avatarFedor Indutny <fedor@indutny.com>
Reviewed-By: default avatarShigeki Ohtsu <ohtsu@iij.ad.jp>
parent 3f821b96
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment