This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
tls.checkServerIdentity throws TypeError: Cannot read property 'CN' of undefined (tls.js:182:37) #9272
Labels
Comments
Agreed on the point that the code ought to be checking cert.subject. |
Any updates on this issue? |
seeing the same issue. should we reopen in the io.js or node.js-convergence repos? |
avwo
pushed a commit
to avwo/whistle
that referenced
this issue
Aug 6, 2015
avwo
pushed a commit
to avwo/whistle
that referenced
this issue
Aug 6, 2015
mike-zorn
pushed a commit
to mike-zorn/io.js
that referenced
this issue
Aug 10, 2015
This resolves nodejs/node-v0.x-archive#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`.
rvagg
pushed a commit
to nodejs/node
that referenced
this issue
Aug 21, 2015
This resolves nodejs/node-v0.x-archive#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: #2343 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Shigeki Ohtsu <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have a script that connects to my FTPS server (vsftpd) with a valid TLS certificate.
This script was running with node 0.10.x, but with node 0.12.0 it throws the exception:
My debugging showed me that cert is an empty object.
This object comes from _tls_wrap.js - getPeerCertificate().
The documentation says: "If the peer does not provide a certificate, it returns null or an empty object."
So checkServerIdentity should check if cert has a cert.subject instead of throwing this exception.
And I do not know why cert is an empty object because there should be a valid certificate.
The text was updated successfully, but these errors were encountered: