Skip to content

A module which allows you to check the certificate of a given hostname is valid

Notifications You must be signed in to change notification settings

Lisiadito/checkSslCertificate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version

checkSslCertificate

A module which allows you to check the certificate of a given hostname is valid.

  • Typescript support
  • Module import or usage via CLI

This module returns a Promise which will always resolve.

In case of an error the returned object will contain have an error property.

Installation

To install this package run:

$ npm install checkSslCertificate --save 
# Or
$ yarn add checkSslCertificate

For the usage via CLI it is recommended to install the package globally.

$ npm install -g checkSslCertificate
# Or
$ yarn global add checkSslCertificate

Usage

import checkSslCertificate from 'checkSslCertificate'
// or 
// const checkSslCertificate = require('checkSslCertificate').default

checkSslCertificate({hostname: 'github.com'}).then(res => {
   console.log(res)
})

or from command line

checksslcertificate -h example.com 

Options

UrlObject

Properties Type Required Default Example
hostname string true - 'example.com'
method string false 'HEAD' 'GET'
path string false - '/foo'
port number false 443 444

Return Value

SslCheckResponse

Properties Type Optional Example
error string true
originalObject UrlObject false {hostname: 'example.com'}
valid boolean false true
validFrom string true 'May 8 00:00:00 2018 GMT'
validUntil string true 'Jun 3 12:00:00 2020 GMT'

About

A module which allows you to check the certificate of a given hostname is valid

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published