From 31823f628256db38a8ef9d86b2db852909ee1a22 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 23 Nov 2018 11:26:18 -0800 Subject: [PATCH] Check if result is not null --- src/reverseproxy.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/reverseproxy.js b/src/reverseproxy.js index b80821f16..f24c43cff 100644 --- a/src/reverseproxy.js +++ b/src/reverseproxy.js @@ -114,6 +114,8 @@ function isExpiringSync(certFilePath, hours) { var result = safe.child_process.spawnSync('/usr/bin/openssl', [ 'x509', '-checkend', String(60 * 60 * hours), '-in', certFilePath ]); + if (!result) return 3; // some error + debug('isExpiringSync: %s %s %s', certFilePath, result.stdout.toString('utf8').trim(), result.status); return result.status === 1; // 1 - expired 0 - not expired