npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cmr1-ssl-validator

v0.4.2

Published

Scan and validate SSL certificate(s)

Downloads

34

Readme

npm version build status

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:

# Scan & validate current directory
ssl-validator 

# Scan & validate default Let's Encrypt directory
ssl-validator /etc/letsencrypt/live --recursive

# Scan & validate default dehydrated directory
ssl-validator /etc/dehydrated/certs --recursive

Advanced cli example:

ssl-validator \
  # Use recursive flag to group certs by directory
  --recursive \

  # Scan & validate default dehydrated directory
  --directory /etc/dehydrated/certs \          
  
  # Provide cert & key file regular expressions
  --certfile "^(fullchain|cert).pem$" \
  --keyfile "^privkey.pem$" \

  # Provide expiration period in days
  --time 30 \

  # Provide a slack webhook URL for notifications
  --slack https://hooks.slack.com/services/foo/bar/foobar \

  # Provide an executable hook to trigger with invalid certificate info
  --hook /usr/bin/foo-bar \

  # Validate certificates stored on AWS Certificate Manager (ACM)
  --acm

Back to Top

Module

Install locally:

npm install --save cmr1-ssl-validator

Basic code example:

// Require cmr1-ssl-validator module
const SslValidator = require('cmr1-ssl-validator');

// Create a new validator with default options
const validator = new SslValidator();

// Run validator with default options
validator.run(err => {
  if (err) {
    // Something went wrong
    validator.error(err);
  } else {
    // All finished
    validator.log('Finished.');
  }
});

Advanced code example:

// Require cmr1-ssl-validator module
const SslValidator = require('cmr1-ssl-validator');

// Create a new validator with default options
const validator = new SslValidator({
  // Use recursive flag to group certs by directory
  recursive: true,

  // Scan & validate default dehydrated directory
  directory: '/etc/dehydrated/certs',

  // Provide cert & key file regular expressions
  certfile: '^(fullchain|cert).pem$',
  keyfile: '^privkey.pem$',

  // Provide expiration period in days
  time: 30,

  // Provide a slack webhook URL for notifications
  slack: 'https://hooks.slack.com/services/foo/bar/foobar',

  // Provide an executable hook to trigger with invalid certificate info
  hook: '/usr/bin/foo-bar',

  // Validate certificates stored on AWS Certificate Manager (ACM)
  acm: true
});

// Run validator with default options
validator.run(err => {
  if (err) {
    // Something went wrong
    validator.error(err);
  } else {
    // All finished
    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