Chore: Record start time after null check

Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com>
This commit is contained in:
Nelson Chan 2024-04-07 21:44:38 +08:00 committed by GitHub
parent 1a2f5b6380
commit 1f62c78f4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -657,12 +657,12 @@ const parseCertificateInfo = function (info) {
* @returns {object} Object containing certificate information
*/
exports.checkCertificate = function (socket) {
let certInfoStartTime = dayjs().valueOf();
// Return null if there is no socket
if (socket === undefined || socket == null) {
return null;
}
let certInfoStartTime = dayjs().valueOf();
const info = socket.getPeerCertificate(true);
const valid = socket.authorized || false;