Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
cert-expiry-check
Advanced tools
A module to check the expiry of SSL/TLS certs.
In it's most basic form, using the default configuration:
const CertExpiryCheck = require('cert-expiry-check');
const checker = new CertExpiryCheck();
checker.checkHosts([{
hostname: 'www.google.com'
}]).then((results) => {
console.log(results);
}).catch((e) => {
console.error(e); // bubbles up HTTP errors and invalid cert chains
});
Gives the following result:
[{
"host":{
"hostname":"www.google.com",
"port":443,
"alertWindowDays":30,
"headers":{
"User-Agent":"SSL Certificate Expiry Checker 0.1.0"
},
"method":"GET"
},
"details":{
"subject":{
"org":"Google Inc",
"commonName":"www.google.com",
"altName":"DNS:www.google.com"
},
"issuer":{
"org":"Google Inc",
"commonName":"Google Internet Authoritym G2"
}
},
"validFrom":"2016-05-18T10:59:02.000Z",
"validTo":"2016-08-10T10:46:00.000Z",
"expiry":{
"days":72,
"milliseconds":6198331472,
"isExpired":false,
"isInAlertWindow":false
}
}]
There are two types of configurations that can be performed, first the 'global' defaults used for all checked domains:
const checker = new CertExpiryCheck({
timeout: 5000, // timeout used for HTTPS connections
defaultPort: 443, // port used for all HTTPS connections
defaultAlertWindowDays: 30, // default alert window to use for near expiry certs
userAgent: 'SSL Certificate Expiry Checker 0.1.0' // default user agent to send with requests
});
Secondly, the per host configurations that override the defaults (above) for each host to check:
checker.checkHosts([{
hostname: 'www.google.com',
port: 443,
alertWindowDays: 30,
userAgent: 'SSL Certificate Expiry Checker 0.1.0'
}]).then((results) => {
console.log(results);
})
Note: There is currently no support for self-signed certs, as this was outside of the core use-case. Happy to accept pull requests for support however.
git clone https://github.com/Joe8Bit/cert-expiry-check
cd cert-expiry-check
npm install -g ava nyc eslint babel-eslint && npm install
npm test
All contributors agree to abide by the CODE_OF_CONDUCT.md
MIT
FAQs
A module to check the expiry of HTTPS certificates
The npm package cert-expiry-check receives a total of 0 weekly downloads. As such, cert-expiry-check popularity was classified as not popular.
We found that cert-expiry-check demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.