
node-ssl-validator
Scan and validate SSL certificates
Table of contents
CLI
Install globally:
npm install -g cmr1-ssl-validator
Show help:
ssl-validator --help
Basic cli example:
ssl-validator
ssl-validator /etc/letsencrypt/live --recursive
ssl-validator /etc/dehydrated/certs --recursive
Advanced cli example:
ssl-validator \
--recursive \
--directory /etc/dehydrated/certs \
--certfile "^(fullchain|cert).pem$" \
--keyfile "^privkey.pem$" \
--time 30 \
--slack https://hooks.slack.com/services/foo/bar/foobar \
--hook /usr/bin/foo-bar \
--acm
Back to Top
Module
Install locally:
npm install --save cmr1-ssl-validator
Basic code example:
const SslValidator = require('cmr1-ssl-validator');
const validator = new SslValidator();
validator.run(err => {
if (err) {
validator.error(err);
} else {
validator.log('Finished.');
}
});
Advanced code example:
const SslValidator = require('cmr1-ssl-validator');
const validator = new SslValidator({
recursive: true,
directory: '/etc/dehydrated/certs',
certfile: '^(fullchain|cert).pem$',
keyfile: '^privkey.pem$',
time: 30,
slack: 'https://hooks.slack.com/services/foo/bar/foobar',
hook: '/usr/bin/foo-bar',
acm: true
});
validator.run(err => {
if (err) {
validator.error(err);
} else {
validator.log('Finished.');
}
});
Back to Top
Hooks
An executable can be called after completion with information about failure(s).
Hook arguments:
/path/to/hook EXIT_CODE [DOMAIN_LIST]
EXIT_CODE
is the exit status of the validator (0
or 1
)
DOMAIN_LIST
a list of invalid domains, grouped by certificate
- Domains are joined by
,
- Groups are joined by
;
- Example:
abc.co,www.abc.co;xyz.co,www.xyz.co
- Two certs:
abc.co
& xyz.co
, both with alternate domain name: www.
Success example:
/path/to/hook 0
Failure example:
/path/to/hook 1 abc.co,www.abc.co;xyz.co,www.xyz.co
Back to Top