From f6d0f28b3a4611336cfdddbc43b8ed2b61404ae7 Mon Sep 17 00:00:00 2001 From: Sebastian Kaempfe Date: Thu, 12 Jan 2023 11:34:37 +0100 Subject: [PATCH] [#2593] during certificate evaluation also set the cert type for improved notifications --- server/util-server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/util-server.js b/server/util-server.js index 60d8baac7..d9741a7c6 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -445,12 +445,16 @@ const parseCertificateInfo = function (info) { // Move up the chain until loop is encountered if (link.issuerCertificate == null) { + link.certType = (i === 0) ? "self-signed" : "root CA"; break; } 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}`); + link.certType = (i === 0) ? "self-signed" : "root CA"; link.issuerCertificate = null; break; } else { + link.certType = (i === 0) ? "server" : "intermediate CA"; link = link.issuerCertificate; }