Project

ssl_expiry

0.0
A long-lived project that still receives updates
A simple gem checking for ssl expiry.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.8.0
~> 6
~> 1.50.0
>= 1.17, < 3.0
~> 13.0
~> 3.0

Runtime

 Project Readme

DevelopersToolbox logo
Github Build Status License Created
Release Released Commits since release

Overview

This is a simple little gem for checking when an SSL will expire.

Installation

Add this line to your application's Gemfile:

gem 'ssl_expiry'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ssl_expiry

Usage

Simple Usage

require 'ssl_expiry'

SSLExpiry::SSLExpiry.check_certificates('wolfsoftware.com')

Results:
{"wolfsoftware.com"=>{"status"=>200, "expires_on"=>"02 Aug 2024", "expires_in"=>57, "common_name"=>"wolfsoftware.com", "issuer"=>"Let's Encrypt"}}

Multiple Domains

It is possible to check a list of domains rather than just single domains, this is done by passing a list[] to SSLExpiry::SSLExpiry.check_certificates.

require 'ssl_expiry'

SSLExpiry::SSLExpiry.check_certificates(['wolfsoftware.com', 'wolfsoftware.net'])

Displaying the output

require 'ssl_expiry'

results = SSLExpiry::SSLExpiry.check_certificates('wolfsoftware.com')
SSLExpiry::SSLExpiry.display_results(results)

This would give the following output

----------------------------------------------------------------------------------------------------
 Domain                         | Status
----------------------------------------------------------------------------------------------------
 wolfsoftware.com               | expires on 02 Aug 2024 (in 57 days) [CN=wolfsoftware.com]
----------------------------------------------------------------------------------------------------

Command Line Tools

There is a command line tool included with this gem.

check-ssl -d wolfsoftware.com

----------------------------------------------------------------------------------------------------
 Domain                         | Status
----------------------------------------------------------------------------------------------------
 wolfsoftware.com               | expires on 02 Aug 2024 (in 57 days) [CN=wolfsoftware.com]
----------------------------------------------------------------------------------------------------

Multiple Domains

To check multiple domains at the same time, simply supply a comma separated list.

check-ssl -d wolfsoftware.com,wolfsoftware.net

------------------------------------------------------------------------------------------------------------------------
 Domain                         | Status
------------------------------------------------------------------------------------------------------------------------
 wolfsoftware.com               | expires on 02 Aug 2024 (in 57 days) [CN=wolfsoftware.com]
 wolfsoftware.net               | expires on 02 Aug 2024 (in 57 days) [CN=wolfsoftware.net]
------------------------------------------------------------------------------------------------------------------------

Custom port

If you want to check an SSL expiry on a custom port you can do this by adding the port to the end of the domain.

  check-ssl -d wolfsoftware.com:8080