https://github.com/developerstoolbox/ssl-expiry-gem
A simple ruby gem for checking when ssl certificates expire
https://github.com/developerstoolbox/ssl-expiry-gem
Last synced: 11 months ago
JSON representation
A simple ruby gem for checking when ssl certificates expire
- Host: GitHub
- URL: https://github.com/developerstoolbox/ssl-expiry-gem
- Owner: DevelopersToolbox
- License: mit
- Created: 2023-03-31T09:41:32.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2025-07-28T05:45:32.000Z (11 months ago)
- Last Synced: 2025-07-28T07:26:32.458Z (11 months ago)
- Language: Ruby
- Size: 203 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
## Overview
This is a simple little gem for checking when an SSL will expire.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'ssl_expiry'
```
And then execute:
```
$ bundle
```
Or install it yourself as:
```
$ gem install ssl_expiry
```
## Usage
### Simple Usage
```ruby
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.
```ruby
require 'ssl_expiry'
SSLExpiry::SSLExpiry.check_certificates(['wolfsoftware.com', 'wolfsoftware.net'])
```
### Displaying the output
```ruby
require 'ssl_expiry'
results = SSLExpiry::SSLExpiry.check_certificates('wolfsoftware.com')
SSLExpiry::SSLExpiry.display_results(results)
```
This would give the following output
```shell
----------------------------------------------------------------------------------------------------
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.
```shell
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.
```shell
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
```