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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@imdevesh/verify-valid-ssl

v1.0.2

Published

This module is a validator for SSL Certificates using the PEM node module. You can validate SSL Keys, SSL Certificates, SSL Certificate Domains, SSL Certificate Bundles, etc.

Readme

Verify valid SSL Certs

npm version

This module is a validator for SSL Certificates using the PEM node module. You can validate SSL Keys, SSL Certificates, SSL Certificate Domains, SSL Certificate Bundles, etc.

Installation

npm i @imdevesh/verify-valid-ssl

or

yarn add @imdevesh/verify-valid-ssl

API Documentation

All of these functions will throw an error if something is invalid, except the isValid functions, which will return true or false.

Validate SSL

const { validateSSL } = require("@imdevesh/verify-valid-ssl");

await validateSSL(cert, options);

| Option | Type | Default | Description | | :----------------- | :------ | ------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | skipDateValidation | Boolean | false | Skip verifying the certificate's and/or bundle's validity period. | | key | String | | When given, validates that the key and certificate are a pair. | | domain | String | | When given, verifies the certificate is valid for this domain. e.g. 'github.com' | | bundle | String | | When given, verifies the certificate bundle and certificate go together. |

Validate SSL Cert

This function validates that the certificate is an SSL certificate and checks the validity period.

const { validateSSLCert } = require("@imdevesh/verify-valid-ssl");
await validateSSLCert(cert, options);

| Option | Type | Default | Description | | :----------------- | :------ | ------- | :------------------------------------------------------ | | skipDateValidation | Boolean | false | Skip verifying the given certificate's validity period. |

Validate SSL Key

This function validates that the certificate is an SSL certificate and checks the validity period.

const { validateSSLKey } = require("@imdevesh/verify-valid-ssl");
await validateSSLKey(key);

Validate Cert Bundle

This function validates that the certificate and the bundle are certificates, and ensures that the bundle and certificate go together.

const { validateCertBundle } = require("@imdevesh/verify-valid-ssl";
await validateCertBundle(cert, bundle, options);

| Option | Type | Default | Description | | :----------------- | :------ | ------- | :------------------------------------------------------------- | | skipDateValidation | Boolean | false | Skip verifying the certificate's and bundle's validity period. |

Validate Cert Key Pair

This function validates that the given certificate and key are a matching pair.

const { validateCertKeyPair } = require("@imdevesh/verify-valid-ssl");
await validateCertKeyPair(cert, key, options);

| Option | Type | Default | Description | | :----------------- | :------ | ------- | :------------------------------------------------------ | | skipDateValidation | Boolean | false | Skip verifying the given certificate's validity period. |

Validate Cert To Domain

This function validates the given certificate and that it matches the given domain.

const { validateCertToDomain } = require("@imdevesh/verify-valid-ssl");
await validateCertToDomain(cert, domain, options);

| Option | Type | Default | Description | | :----------------- | :------ | ------- | :------------------------------------------------------ | | skipDateValidation | Boolean | false | Skip verifying the given certificate's validity period. |

IsValid Functions

Each of the functions listed above (validateSSL, validateSSLCert, etc.) has a counterpart that will not throw any errors but will return true when valid and false when not valid. All arguments and options are listed above are valid.

| Original Function Name | Predicate Function Name | | :--------------------- | :---------------------- | | validateSSL | isValidSSL | | validateSSLCert | isValidSSLCert | | validateSSLKey | isValidSSLKey | | validateCertBundle | isValidCertBundle | | validateCertKeyPair | isValidCertKeyPair | | validateCertToDomain | isValidCertToDomain |

const { isValidSSL } = require("@imdevesh/verify-valid-ssl");
if (!(await isValidSSL(cert))) {
    return { message: "Sorry, the certificate supplied is not valid." };
}

License

The module is available as open source under the terms of the Apache v2.0.