check-cert-expiration
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -34,4 +34,6 @@ "use strict"; | ||
}, () => { | ||
result.valid_to = new Date(sd.getPeerCertificate().valid_to).toJSON(); // ISO8601 | ||
const peerCertificate = sd.getPeerCertificate(true); | ||
result.valid_to = new Date(peerCertificate.valid_to).toJSON(); // ISO8601 | ||
result.daysLeft = moment(result.valid_to, moment.ISO_8601).diff(moment(), 'days'); | ||
result.fingerprint = peerCertificate.issuerCertificate.fingerprint; | ||
sd.end(); | ||
@@ -38,0 +40,0 @@ resolve(result); |
@@ -1,2 +0,2 @@ | ||
Copyright (c) 2016, 2017, 2019, 2020 Thomas Cort <linuxgeek@gmail.com> | ||
Copyright (c) 2016-2021 Thomas Cort <linuxgeek@gmail.com> | ||
@@ -3,0 +3,0 @@ Permission to use, copy, modify, and distribute this software for any |
{ | ||
"name": "check-cert-expiration", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "query an SSL/TLS server and report its certificate's expiration date", | ||
@@ -31,7 +31,7 @@ "main": "index.js", | ||
"dependencies": { | ||
"moment": "^2.24.0", | ||
"lodash": "^4.17.15" | ||
"moment": "^2.29.1", | ||
"lodash": "^4.17.21" | ||
}, | ||
"devDependencies": { | ||
"jshint": "^2.11.0" | ||
"jshint": "^2.12.0" | ||
}, | ||
@@ -38,0 +38,0 @@ "jshintConfig": { |
@@ -22,3 +22,2 @@ # check-cert-expiration | ||
# check a number of sites: | ||
$ check-cert-expiration tomcort.com github.com | ||
@@ -28,3 +27,2 @@ host=tomcort.com port=443 valid_to=2018-03-09T10:34:20.000Z daysLeft=89 | ||
# check for certificate expiring in the next two weeks: | ||
$ check-cert-expiration --days-left 14 tomcort.com | ||
@@ -31,0 +29,0 @@ host=tomcort.com port=443 valid_to=2020-05-16T17:38:41.000Z daysLeft=37 |
8979
42
100
Updatedlodash@^4.17.21
Updatedmoment@^2.29.1