diff --git a/server/util-server.js b/server/util-server.js index c1bae84fc..0bf69133b 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -470,6 +470,10 @@ const parseCertificateInfo = function (info) { * @returns {Object} Object containing certificate information */ exports.checkCertificate = function (res) { + if (!res.request.res.socket) { + throw new Error("No socket found"); + } + const info = res.request.res.socket.getPeerCertificate(true); const valid = res.request.res.socket.authorized || false;