|
|
@ -445,12 +445,16 @@ const parseCertificateInfo = function (info) {
|
|
|
|
|
|
|
|
|
|
|
|
// Move up the chain until loop is encountered
|
|
|
|
// Move up the chain until loop is encountered
|
|
|
|
if (link.issuerCertificate == null) {
|
|
|
|
if (link.issuerCertificate == null) {
|
|
|
|
|
|
|
|
link.certType = (i === 0) ? "self-signed" : "root CA";
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
} else if (link.issuerCertificate.fingerprint in existingList) {
|
|
|
|
} else if (link.issuerCertificate.fingerprint in existingList) {
|
|
|
|
|
|
|
|
// a root CA certificate is typically "signed by itself" (=> "self signed certificate") and thus the "issuerCertificate" is a reference to itself.
|
|
|
|
log.debug("cert", `[Last] ${link.issuerCertificate.fingerprint}`);
|
|
|
|
log.debug("cert", `[Last] ${link.issuerCertificate.fingerprint}`);
|
|
|
|
|
|
|
|
link.certType = (i === 0) ? "self-signed" : "root CA";
|
|
|
|
link.issuerCertificate = null;
|
|
|
|
link.issuerCertificate = null;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
link.certType = (i === 0) ? "server" : "intermediate CA";
|
|
|
|
link = link.issuerCertificate;
|
|
|
|
link = link.issuerCertificate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|