ssl_expiry 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96cbba1150d51acb0a1f4d27f9634e3b7f92f2ea4fa4f41bae2e848484a0c078
4
- data.tar.gz: 5c0cb052de1b6da7e3881dcbc7aafafa048e991404c9c535f9a401c9248e3c85
3
+ metadata.gz: 988e8afbfb0f24fad53548837d1d40d20190fd5ea88fb998f0ab294f6eebd3c9
4
+ data.tar.gz: 83ed72017f68cf84bbc6c9437f4c312b7d1f0645c2ee68a06b98770aa58cb39d
5
5
  SHA512:
6
- metadata.gz: c86634f01a0cb849634e2ba8b5d0eac5f931f8193a928a1d6584f926679e6d49b6772f3af77e3f161bd38bc9d2ee5a29c9436dc0030c2d8b1cdf7983851874f9
7
- data.tar.gz: 7038c81c4247218ae59484d62e853b892135ae52ec2ef2e66d1f207c9ec55dd250dcbe93f0facf1bbbdde89604c1e88a444574baf25bcbd8619f06f5d306e11e
6
+ metadata.gz: 3cac7b6ce8a38dee00bebb2de7e750b45f5545f2f3d1151c77130188da4e7afa71d2f2ca88d11e647f82a123108e84c910fcba42aaa18bbd53e31cbcb4c67e84
7
+ data.tar.gz: 0e5fa4b464953186ac0dde66cf3dc6939cea89f5bcda45030d080e9a926cc886dd8737e6f4d5b29b11de5169e2910ec4c432e372f87ce10f66fa4e6fe5e0a625
data/LICENSE.md ADDED
@@ -0,0 +1,25 @@
1
+ The MIT License (MIT)
2
+ =====================
3
+
4
+ Copyright © `2009-2024` `Wolf Software`
5
+
6
+ Permission is hereby granted, free of charge, to any person
7
+ obtaining a copy of this software and associated documentation
8
+ files (the “Software”), to deal in the Software without
9
+ restriction, including without limitation the rights to use,
10
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the
12
+ Software is furnished to do so, subject to the following
13
+ conditions:
14
+
15
+ The above copyright notice and this permission notice shall be
16
+ included in all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25
+ OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,12 +1,44 @@
1
- [![Build Status](https://img.shields.io/travis/AntiPhotonltd/ssl_expiry/master.svg)](https://travis-ci.org/AntiPhotonltd/ssl_expiry)
2
- [![Software License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)
3
- [![Release](https://img.shields.io/github/release/AntiPhotonltd/ssl_expiry.svg)](https://github.com/AntiPhotonltd/ssl_expiry/releases/latest)
4
- [![Gem Version](https://badge.fury.io/rb/ssl_expiry.svg)](https://badge.fury.io/rb/ssl_expiry)
5
- [![Github commits (since latest release)](https://img.shields.io/github/commits-since/AntiPhotonltd/ssl_expiry/latest.svg)](https://github.com/AntiPhotonltd/ssl_expiry/commits)
6
- [![GitHub repo size in bytes](https://img.shields.io/github/repo-size/AntiPhotonltd/ssl_expiry.svg)](https://github.com/AntiPhotonltd/ssl_expiry)
7
- [![GitHub contributors](https://img.shields.io/github/contributors/AntiPhotonltd/ssl_expiry.svg)](https://github.com/AntiPhotonltd/ssl_expiry)
8
-
9
- # SSL Expiry
1
+ <!-- markdownlint-disable -->
2
+ <p align="center">
3
+ <a href="https://github.com/DevelopersToolbox/">
4
+ <img src="https://cdn.wolfsoftware.com/assets/images/github/organisations/developerstoolbox/black-and-white-circle-256.png" alt="DevelopersToolbox logo" />
5
+ </a>
6
+ <br />
7
+ <a href="https://github.com/DevelopersToolbox/ssl-expiry-gem/actions/workflows/cicd.yml">
8
+ <img src="https://img.shields.io/github/actions/workflow/status/DevelopersToolbox/ssl-expiry-gem/cicd.yml?branch=master&label=build%20status&style=for-the-badge" alt="Github Build Status" />
9
+ </a>
10
+ <a href="https://github.com/DevelopersToolbox/ssl-expiry-gem/blob/master/LICENSE.md">
11
+ <img src="https://img.shields.io/github/license/DevelopersToolbox/ssl-expiry-gem?color=blue&label=License&style=for-the-badge" alt="License">
12
+ </a>
13
+ <a href="https://github.com/DevelopersToolbox/ssl-expiry-gem">
14
+ <img src="https://img.shields.io/github/created-at/DevelopersToolbox/ssl-expiry-gem?color=blue&label=Created&style=for-the-badge" alt="Created">
15
+ </a>
16
+ <br />
17
+ <a href="https://github.com/DevelopersToolbox/ssl-expiry-gem/releases/latest">
18
+ <img src="https://img.shields.io/github/v/release/DevelopersToolbox/ssl-expiry-gem?color=blue&label=Latest%20Release&style=for-the-badge" alt="Release">
19
+ </a>
20
+ <a href="https://github.com/DevelopersToolbox/ssl-expiry-gem/releases/latest">
21
+ <img src="https://img.shields.io/github/release-date/DevelopersToolbox/ssl-expiry-gem?color=blue&label=Released&style=for-the-badge" alt="Released">
22
+ </a>
23
+ <a href="https://github.com/DevelopersToolbox/ssl-expiry-gem/releases/latest">
24
+ <img src="https://img.shields.io/github/commits-since/DevelopersToolbox/ssl-expiry-gem/latest.svg?color=blue&style=for-the-badge" alt="Commits since release">
25
+ </a>
26
+ <br />
27
+ <a href="https://github.com/DevelopersToolbox/ssl-expiry-gem/blob/master/.github/CODE_OF_CONDUCT.md">
28
+ <img src="https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge" />
29
+ </a>
30
+ <a href="https://github.com/DevelopersToolbox/ssl-expiry-gem/blob/master/.github/CONTRIBUTING.md">
31
+ <img src="https://img.shields.io/badge/Contributing-blue?style=for-the-badge" />
32
+ </a>
33
+ <a href="https://github.com/DevelopersToolbox/ssl-expiry-gem/blob/master/.github/SECURITY.md">
34
+ <img src="https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge" />
35
+ </a>
36
+ <a href="https://github.com/DevelopersToolbox/ssl-expiry-gem/issues">
37
+ <img src="https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge" />
38
+ </a>
39
+ </p>
40
+
41
+ ## Overview
10
42
 
11
43
  This is a simple little gem for checking when an SSL will expire.
12
44
 
@@ -20,42 +52,55 @@ gem 'ssl_expiry'
20
52
 
21
53
  And then execute:
22
54
 
23
- $ bundle
55
+ ```
56
+ $ bundle
57
+ ```
24
58
 
25
59
  Or install it yourself as:
26
60
 
27
- $ gem install ssl_expiry
61
+ ```
62
+ $ gem install ssl_expiry
63
+ ```
28
64
 
29
65
  ## Usage
30
66
 
31
67
  ### Simple Usage
32
68
  ```ruby
33
- require 'ssl_expiry'
69
+ require 'ssl_expiry'
34
70
 
35
- SSLExpiry::SSLExpiry.check_certificates('antiphoton.com')
71
+ SSLExpiry::SSLExpiry.check_certificates('wolfsoftware.com')
36
72
 
37
- Results:
38
- {"antiphoton.com"=>{"status"=>200, "expires_on"=>"09 Mar 2019", "expires_in"=>16, "common_name"=>"antiphoton.com", "issuer"=>"COMODO CA Limited"}}
73
+ Results:
74
+ {"wolfsoftware.com"=>{"status"=>200, "expires_on"=>"02 Aug 2024", "expires_in"=>57, "common_name"=>"wolfsoftware.com", "issuer"=>"Let's Encrypt"}}
75
+ ```
76
+
77
+ #### Multiple Domains
78
+
79
+ 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.
80
+
81
+ ```ruby
82
+ require 'ssl_expiry'
83
+
84
+ SSLExpiry::SSLExpiry.check_certificates(['wolfsoftware.com', 'wolfsoftware.net'])
39
85
  ```
40
86
 
41
87
  ### Displaying the output
42
88
 
43
89
  ```ruby
44
- require 'ssl_expiry'
90
+ require 'ssl_expiry'
45
91
 
46
- results = SSLExpiry::SSLExpiry.check_certificates(['antiphoton.com','wolfsoftware.com'])
47
- SSLExpiry::SSLExpiry.display_results(results)
92
+ results = SSLExpiry::SSLExpiry.check_certificates('wolfsoftware.com')
93
+ SSLExpiry::SSLExpiry.display_results(results)
48
94
  ```
49
95
 
50
96
  This would give the following output
51
97
 
52
98
  ```shell
53
- ----------------------------------------------------------------------------------------------------
54
- Domain | Status
55
- ----------------------------------------------------------------------------------------------------
56
- antiphoton.com | expires on 09 Mar 2019 (in 16 days) [CN=antiphoton.com]
57
- wolfsoftware.com | expires on 12 Sep 2019 (in 203 days) [CN=*.wolfsoftware.com]
58
- ----------------------------------------------------------------------------------------------------
99
+ ----------------------------------------------------------------------------------------------------
100
+ Domain | Status
101
+ ----------------------------------------------------------------------------------------------------
102
+ wolfsoftware.com | expires on 02 Aug 2024 (in 57 days) [CN=wolfsoftware.com]
103
+ ----------------------------------------------------------------------------------------------------
59
104
  ```
60
105
 
61
106
  ## Command Line Tools
@@ -63,41 +108,37 @@ This would give the following output
63
108
  There is a command line tool included with this gem.
64
109
 
65
110
  ```shell
66
- check-ssl -d antiphoton.com
111
+ check-ssl -d wolfsoftware.com
67
112
 
68
- ----------------------------------------------------------------------------------------------------
69
- Domain | Status
70
- ----------------------------------------------------------------------------------------------------
71
- antiphoton.com | expires on 09 Mar 2019 (in 16 days) [CN=antiphoton.com]
72
- ----------------------------------------------------------------------------------------------------
113
+ ----------------------------------------------------------------------------------------------------
114
+ Domain | Status
115
+ ----------------------------------------------------------------------------------------------------
116
+ wolfsoftware.com | expires on 02 Aug 2024 (in 57 days) [CN=wolfsoftware.com]
117
+ ----------------------------------------------------------------------------------------------------
73
118
  ```
74
119
 
75
- ### Custom port
120
+ ### Multiple Domains
76
121
 
77
- 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.
122
+ To check multiple domains at the same time, simply supply a comma separated list.
78
123
 
124
+ ```shell
125
+ check-ssl -d wolfsoftware.com,wolfsoftware.net
126
+
127
+ ------------------------------------------------------------------------------------------------------------------------
128
+ Domain | Status
129
+ ------------------------------------------------------------------------------------------------------------------------
130
+ wolfsoftware.com | expires on 02 Aug 2024 (in 57 days) [CN=wolfsoftware.com]
131
+ wolfsoftware.net | expires on 02 Aug 2024 (in 57 days) [CN=wolfsoftware.net]
132
+ ------------------------------------------------------------------------------------------------------------------------
79
133
  ```
80
- check-ssl -d antiphoton.com:8080
81
- ```
82
-
83
- ## Development
84
-
85
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
86
-
87
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
88
-
89
- ## Testing
90
-
91
- For local testing make sure that you run `bundle exec rspec spec` and then `rake install` to install the gem locally.
92
134
 
93
- ## Contributing
94
-
95
- Bug reports and pull requests are welcome on GitHub at https://github.com/AntiPhotonltd/ssl_expiry. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
96
-
97
- ## License
135
+ ### Custom port
98
136
 
99
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
137
+ 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.
100
138
 
101
- ## Code of Conduct
139
+ ```
140
+ check-ssl -d wolfsoftware.com:8080
141
+ ```
102
142
 
103
- Everyone interacting in the SSLExpiry project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/AntiPhotonltd/ssl_expiry/blob/master/CODE_OF_CONDUCT.md).
143
+ <br />
144
+ <p align="right"><a href="https://wolfsoftware.com/"><img src="https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge" /></a></p>
data/exe/check-ssl CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
2
 
4
3
  require 'optparse'
5
4
  require 'ssl_expiry'
@@ -13,6 +12,7 @@ require 'ssl_expiry'
13
12
  # This is the main processing function where all the processing logic is handled. #
14
13
  # -------------------------------------------------------------------------------- #
15
14
 
15
+ # This method smells of :reek:NilCheck, :reek:UncommunicativeVariableName
16
16
  def process_arguments
17
17
  options = {}
18
18
  # Enforce the presence of
@@ -32,17 +32,17 @@ def process_arguments
32
32
 
33
33
  begin
34
34
  optparse.parse!
35
- options[:message] = ARGF.read unless STDIN.tty? # override message parameter if data is piped in
35
+ options[:message] = ARGF.read unless $stdin.tty? # override message parameter if data is piped in
36
36
  missing = mandatory.select { |param| options[param].nil? }
37
37
  raise OptionParser::MissingArgument.new(missing.join(', ')) unless missing.empty?
38
38
  rescue OptionParser::InvalidOption, OptionParser::MissingArgument => e
39
- puts e.to_s
39
+ puts e
40
40
  puts optparse
41
41
  exit
42
42
  end
43
43
 
44
- results = SSLExpiry::SSLExpiry.check_certificates(options[:domain])
45
- SSLExpiry::SSLExpiry.display_results(results)
44
+ results = SSLExpiry.check_certificates(options[:domain])
45
+ SSLExpiry.display_results(results)
46
46
  end
47
47
 
48
48
  # -------------------------------------------------------------------------------- #
@@ -1,5 +1,19 @@
1
- # frozen_string_literal: true
1
+ class SSLExpiry
2
+ #
3
+ # Catch all - something bad happened but we don't know what
4
+ #
5
+ class UnknownError < StandardError
6
+ def initialize(msg = 'Something bad happen!')
7
+ super
8
+ end
9
+ end
2
10
 
3
- module SSLExpiry
4
- class SSLError < StandardError; end
11
+ #
12
+ # User supplied an invalid token (instead of a missing token)
13
+ #
14
+ class SSLError < StandardError
15
+ def initialize(msg = 'SSL Error')
16
+ super
17
+ end
18
+ end
5
19
  end
@@ -1,5 +1,13 @@
1
- # frozen_string_literal: true
1
+ class SSLExpiry
2
+ # Current major release.
3
+ MAJOR = 1
2
4
 
3
- module SSLExpiry
4
- VERSION = '1.0.3'
5
+ # Current minor release.
6
+ MINOR = 0
7
+
8
+ # Current patch level.
9
+ PATCH = 4
10
+
11
+ # Full release version.
12
+ VERSION = [MAJOR, MINOR, PATCH].join('.').freeze
5
13
  end
data/lib/ssl_expiry.rb CHANGED
@@ -1,54 +1,60 @@
1
- # frozen_string_literal: true
2
-
3
- require 'ssl_expiry/errors'
4
- require 'ssl_expiry/version'
1
+ #
2
+ # Stuff to go here
3
+ #
5
4
 
6
5
  require 'net/http'
7
6
  require 'openssl'
8
7
 
8
+ require 'ssl_expiry/errors'
9
+ require 'ssl_expiry/version'
10
+
9
11
  #
10
12
  # Docs to follow
11
13
  #
12
- module SSLExpiry
14
+ class SSLExpiry
13
15
  #
14
- # Docs to follow
16
+ # Stuff
15
17
  #
16
- class SSLExpiry
17
- def self.get_cert(domain_name, supplied_port = nil, verify = false)
18
- begin
19
- cert = nil
20
18
 
21
- uri = URI::HTTPS.build(host: domain_name)
19
+ class << self
20
+ # This method smells of :reek:NilCheck, :reek:UncommunicativeVariableName, :reek:DuplicateMethodCall
21
+ def get_cert(domain_name, supplied_port = 443)
22
+ cert = nil
22
23
 
23
- port = if supplied_port.nil?
24
- uri.port
25
- else
26
- supplied_port
27
- end
24
+ uri = URI::HTTPS.build(host: domain_name)
25
+ http = Net::HTTP.new(uri.host, supplied_port)
28
26
 
29
- http = Net::HTTP.new(uri.host, port)
27
+ http.use_ssl = true
28
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
29
+ http.open_timeout = 5
30
+ http.read_timeout = 5
31
+ http.ssl_timeout = 5
30
32
 
31
- http.use_ssl = true
32
- http.verify_mode = verify ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
33
- http.open_timeout = 5
34
- http.read_timeout = 5
35
- http.ssl_timeout = 5
33
+ http.start do |h|
34
+ cert = h.peer_cert
35
+ end
36
+ cert
37
+ rescue SocketError, SystemCallError => e
38
+ raise SSLError.new "Bad URL? #{e.message}"
39
+ rescue Net::OpenTimeout
40
+ raise SSLError.new 'Timed out. Is the site up?'
41
+ rescue OpenSSL::SSL::SSLError => e
42
+ raise SSLError.new "We're trying to validate your certificate using TLSv1 It looks like your server doesn't accept it: [#{$ERROR_INFO.message}]" if e.message =~ /sslv3.+tlsv1 alert/i
43
+ end
36
44
 
37
- http.start do |h|
38
- cert = h.peer_cert
39
- end
45
+ def process_certificate(cert, date_format)
46
+ ssl_common_name = cert.subject.to_a.select { |name, _data, _type| name == 'CN' }.first[1]
47
+ issuer_name = cert.issuer.to_a.select { |name, _data, _type| name == 'O' }.first[1]
48
+ expires_on = cert.not_after
49
+ num_days = ((expires_on - Time.now) / 864_00).to_i
40
50
 
41
- cert
42
- rescue SocketError, SystemCallError => e
43
- raise SSLError.new "Bad URL? #{e.message}"
44
- rescue Net::OpenTimeout
45
- raise SSLError.new 'Timed out. Is the site up?'
46
- rescue OpenSSL::SSL::SSLError => e
47
- raise SSLError.new "We're trying to validate your certificate using TLSv1 It looks like your server doesn't accept it: [#{$ERROR_INFO.message}]" if e.message =~ /sslv3.+tlsv1 alert/i
48
- end
51
+ { 'status' => 200, 'expires_on' => expires_on.strftime(date_format), 'expires_in' => num_days, 'common_name' => ssl_common_name, 'issuer' => issuer_name }
52
+ rescue StandardError
53
+ { 'status' => 400, 'error' => 'Parsing error' }
49
54
  end
50
55
 
51
- def self.check_certificates(domains, date_format = '%d %b %Y')
56
+ # This method smells of :reek:DuplicateMethodCall, :reek:UncommunicativeVariableName
57
+ def check_certificates(domains, date_format = '%d %b %Y')
52
58
  results = {}
53
59
 
54
60
  domains = domains.split(',') unless domains.is_a?(Array)
@@ -67,21 +73,13 @@ module SSLExpiry
67
73
  next
68
74
  end
69
75
 
70
- begin
71
- common_name = cert.subject.to_a.select { |name, _data, _type| name == 'CN' }.first[1]
72
- issuer = cert.issuer.to_a.select { |name, _data, _type| name == 'O' }.first[1]
73
- expires_on = cert.not_after
74
- num_days = ((expires_on - Time.now) / 864_00).to_i
75
-
76
- results[domain] = { 'status' => 200, 'expires_on' => expires_on.strftime(date_format), 'expires_in' => num_days, 'common_name' => common_name, 'issuer' => issuer }
77
- rescue StandardError
78
- results[domain] = { 'status' => 400, 'error' => 'Parsing error' }
79
- end
76
+ results[domain] = process_certificate(cert, date_format)
80
77
  end
81
78
  results.sort
82
79
  end
83
80
 
84
- def self.display_results(results, width = 120)
81
+ # This method smells of :reek:DuplicateMethodCall
82
+ def display_results(results, width = 120)
85
83
  delim = '-' * width
86
84
 
87
85
  puts(delim)
@@ -93,7 +91,7 @@ module SSLExpiry
93
91
  else
94
92
  format('expires on %<expires_in>s (in %<expires_on>s days) [CN=%<common_name>s]', expires_in: details['expires_on'], expires_on: details['expires_in'], common_name: details['common_name'])
95
93
  end
96
- printf(" %-30<domain>s | %<status>s\n", domain: domain, status: status)
94
+ printf(" %-30<domain_name>s | %<ssl_status>s\n", domain_name: domain, ssl_status: status)
97
95
  end
98
96
  puts(delim)
99
97
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssl_expiry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
- - Tim Gurney aka Wolf
8
- autorequire:
7
+ - TGWolf
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-07 00:00:00.000000000 Z
11
+ date: 2024-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,20 +30,76 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: net-http-persistent
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '4'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '4'
47
+ - !ruby/object:Gem::Dependency
48
+ name: openssl
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3'
33
61
  - !ruby/object:Gem::Dependency
34
62
  name: rake
35
63
  requirement: !ruby/object:Gem::Requirement
36
64
  requirements:
37
65
  - - "~>"
38
66
  - !ruby/object:Gem::Version
39
- version: '10.0'
67
+ version: '13.0'
40
68
  type: :development
41
69
  prerelease: false
42
70
  version_requirements: !ruby/object:Gem::Requirement
43
71
  requirements:
44
72
  - - "~>"
45
73
  - !ruby/object:Gem::Version
46
- version: '10.0'
74
+ version: '13.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rbs
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 2.8.0
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 2.8.0
89
+ - !ruby/object:Gem::Dependency
90
+ name: reek
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '6'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '6'
47
103
  - !ruby/object:Gem::Dependency
48
104
  name: rspec
49
105
  requirement: !ruby/object:Gem::Requirement
@@ -59,49 +115,49 @@ dependencies:
59
115
  - !ruby/object:Gem::Version
60
116
  version: '3.0'
61
117
  - !ruby/object:Gem::Dependency
62
- name: openssl
118
+ name: rubocop
63
119
  requirement: !ruby/object:Gem::Requirement
64
120
  requirements:
65
121
  - - "~>"
66
122
  - !ruby/object:Gem::Version
67
- version: '2'
123
+ version: 1.50.0
68
124
  type: :development
69
125
  prerelease: false
70
126
  version_requirements: !ruby/object:Gem::Requirement
71
127
  requirements:
72
128
  - - "~>"
73
129
  - !ruby/object:Gem::Version
74
- version: '2'
130
+ version: 1.50.0
75
131
  - !ruby/object:Gem::Dependency
76
- name: net-http-persistent
132
+ name: rubocop-packaging
77
133
  requirement: !ruby/object:Gem::Requirement
78
134
  requirements:
79
135
  - - "~>"
80
136
  - !ruby/object:Gem::Version
81
- version: '3'
137
+ version: 0.5.2
82
138
  type: :development
83
139
  prerelease: false
84
140
  version_requirements: !ruby/object:Gem::Requirement
85
141
  requirements:
86
142
  - - "~>"
87
143
  - !ruby/object:Gem::Version
88
- version: '3'
144
+ version: 0.5.2
89
145
  - !ruby/object:Gem::Dependency
90
- name: openssl
146
+ name: net-http-persistent
91
147
  requirement: !ruby/object:Gem::Requirement
92
148
  requirements:
93
149
  - - "~>"
94
150
  - !ruby/object:Gem::Version
95
- version: '2'
151
+ version: '4'
96
152
  type: :runtime
97
153
  prerelease: false
98
154
  version_requirements: !ruby/object:Gem::Requirement
99
155
  requirements:
100
156
  - - "~>"
101
157
  - !ruby/object:Gem::Version
102
- version: '2'
158
+ version: '4'
103
159
  - !ruby/object:Gem::Dependency
104
- name: net-http-persistent
160
+ name: openssl
105
161
  requirement: !ruby/object:Gem::Requirement
106
162
  requirements:
107
163
  - - "~>"
@@ -114,40 +170,28 @@ dependencies:
114
170
  - - "~>"
115
171
  - !ruby/object:Gem::Version
116
172
  version: '3'
117
- description: A simple gem checking for ssl expiry.
173
+ description:
118
174
  email:
119
- - wolf@tgwolf.com
175
+ - rubygems@wolfsoftware.com
120
176
  executables:
121
177
  - check-ssl
122
178
  extensions: []
123
179
  extra_rdoc_files: []
124
180
  files:
125
- - ".gitignore"
126
- - ".rspec"
127
- - ".rubocop.yml"
128
- - ".travis.yml"
129
- - CHANGELOG.md
130
- - CODEOWNERS
131
- - CODE_OF_CONDUCT.md
132
- - Gemfile
133
- - LICENSE.txt
181
+ - LICENSE.md
134
182
  - README.md
135
- - Rakefile
136
- - bin/console
137
- - bin/setup
138
183
  - exe/check-ssl
139
184
  - lib/ssl_expiry.rb
140
185
  - lib/ssl_expiry/errors.rb
141
186
  - lib/ssl_expiry/version.rb
142
- - spec/spec_helper.rb
143
- - spec/ssl_expiry_spec.rb
144
- - ssl_expiry.gemspec
145
- - testing/check-ssl
146
- homepage: https://github.com/AntiPhotonltd/ssl_expiry
187
+ homepage: https://github.com/DevelopersToolbox/ssl-expiry-gem
147
188
  licenses:
148
189
  - MIT
149
- metadata: {}
150
- post_install_message:
190
+ metadata:
191
+ rubygems_mfa_required: 'true'
192
+ homepage_uri: https://github.com/DevelopersToolbox/ssl-expiry-gem
193
+ source_code_uri: https://github.com/DevelopersToolbox/ssl-expiry-gem
194
+ post_install_message:
151
195
  rdoc_options: []
152
196
  require_paths:
153
197
  - lib
@@ -155,15 +199,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
199
  requirements:
156
200
  - - ">="
157
201
  - !ruby/object:Gem::Version
158
- version: '0'
202
+ version: 3.1.0
159
203
  required_rubygems_version: !ruby/object:Gem::Requirement
160
204
  requirements:
161
205
  - - ">="
162
206
  - !ruby/object:Gem::Version
163
207
  version: '0'
164
208
  requirements: []
165
- rubygems_version: 3.1.2
166
- signing_key:
209
+ rubygems_version: 3.5.11
210
+ signing_key:
167
211
  specification_version: 4
168
212
  summary: A simple gem checking for ssl expiry.
169
213
  test_files: []
data/.gitignore DELETED
@@ -1,14 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- /Gemfile.lock
10
-
11
- *.gem
12
-
13
- # rspec failure tracking
14
- .rspec_status
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,33 +0,0 @@
1
- Layout/IndentationWidth:
2
- Width: 4
3
-
4
- Layout/LineLength:
5
- Enabled: false
6
-
7
- Metrics/AbcSize:
8
- Enabled: false
9
-
10
- Metrics/BlockLength:
11
- Enabled: false
12
-
13
- Metrics/CyclomaticComplexity:
14
- Enabled: false
15
-
16
- Metrics/MethodLength:
17
- Enabled: false
18
-
19
- Metrics/PerceivedComplexity:
20
- Enabled: false
21
-
22
- Style/GlobalVars:
23
- Enabled: false
24
-
25
- Style/RaiseArgs:
26
- EnforcedStyle: compact
27
-
28
- Style/RedundantBegin:
29
- Enabled: false
30
-
31
- Style/WordArray:
32
- EnforcedStyle: brackets
33
-
data/.travis.yml DELETED
@@ -1,66 +0,0 @@
1
- matrix:
2
- include:
3
- - language: ruby
4
- name: "Bundler (rvm 2.4.4 & bundler 1.17.3)"
5
- rvm: 2.4.4
6
- before_install:
7
- - gem install bundler -v 1.17.3
8
- - language: ruby
9
- name: "Bundler (rvm 2.4.4 & bundler 2.0.1)"
10
- rvm: 2.4.4
11
- before_install:
12
- - gem install bundler -v 2.0.1
13
- - language: ruby
14
- name: "Bundler (rvm 2.5.3 & bundler 2.0.1)"
15
- rvm: 2.5.3
16
- before_install:
17
- - gem install bundler -v 2.0.1
18
- - language: ruby
19
- name: "Bundler (rvm 2.6.1 & bundler 2.0.1)"
20
- rvm: 2.6.1
21
- before_install:
22
- - gem install bundler -v 2.0.1
23
- - language: ruby
24
- name: "Rubocop (rvm 2.4.4)"
25
- env: SKIP_INTERPRETER=true
26
- rvm: 2.4.4
27
- before_install:
28
- - git clone https://github.com/TravisToolbox/rubocop-travis.git
29
- install:
30
- - ./rubocop-travis/install.sh
31
- script:
32
- - ./rubocop-travis/scan.sh
33
- - language: ruby
34
- name: "Rubocop (rvm 2.5.3)"
35
- env: SKIP_INTERPRETER=true
36
- rvm: 2.5.3
37
- before_install:
38
- - git clone https://github.com/TravisToolbox/rubocop-travis.git
39
- install:
40
- - ./rubocop-travis/install.sh
41
- script:
42
- - ./rubocop-travis/scan.sh
43
- - language: ruby
44
- name: "Rubocop (rvm 2.6.1)"
45
- env: SKIP_INTERPRETER=true
46
- rvm: 2.6.1
47
- before_install:
48
- - git clone https://github.com/TravisToolbox/rubocop-travis.git
49
- install:
50
- - ./rubocop-travis/install.sh
51
- script:
52
- - ./rubocop-travis/scan.sh
53
- - language: ruby
54
- name: "Link Checker (rvm 2.6.1)"
55
- rvm: 2.6.1
56
- before_install:
57
- - mkdir travis
58
- - git clone https://github.com/TravisToolbox/awesomebot-travis.git travis/awesomebot
59
- install:
60
- - ./travis/awesomebot/install.sh
61
- script:
62
- - ./travis/awesomebot/scan.sh
63
- notifications:
64
- email: false
65
- slack:
66
- secure: u3UC7xkXbiXgWeWkay1G2VBNzUfa6FUvLK4LtkxiaYeF/Y7uQ9As8EZ/0xeTHpr014XY8zTNwdYVntp5hBASxuH+43sWZKIeCRy0YxtQ97f6/0mRSKUVul73XvYcHMns/42Ho17OcAae70r9I59zKJSSz4I9+QnSkoCn1CgYzXGw8u4C9+WLxIbXyG7bKFwhsiIsHOJiBgWy+V9QG5tZfvlQwMwIAlQ0dkwiIkQ3DMq2NpCawFhL0as8f6VatJZMU+D3CG9EU28965rdrivAZ1emJky5HFJ/ZKeacTtbDijFTpeFS7G6ZH+4LavdyFjWCH3hsdIgQ3AhL/F/JjioIIOL6U9pnJbmnihHaxLM/l9wOovmmbjoe/mZPmTtdoUUebY1RBeAp+3l5xz4HOb8zIaPDoejMs75gysXboXQSSLW6oga6XKUNBLyf8PNc5KowoLh2Q2CZV0HyJHwlp3jCUA2E5cL04iGaLpcDTP+vm4zrHD4ICd89EQumyXesowxcyahWTPlH5+CxHSxsJ66peRHHqEW4Si9zR0ssWjmhfzGcoIfMVwPOFwOG/qxvxFAM24tCyOwaSmW1vQXSVFsZ7FHap+lG9yKOKV9Q2ZBREPX0pAJ8ST6zVE6Q4ppOv7t8nGALhjSsXzIOoWqfZdvH0ktyJYo6bpEw/e8YdmRfw8=
data/CHANGELOG.md DELETED
@@ -1,23 +0,0 @@
1
- ## 1.0.3 (February 7, 2020)
2
-
3
- IMPROVEMENTS:
4
-
5
- * Allow the specification of a custom port. ([@TGWolf][])
6
-
7
- ## 1.0.2 (June 28, 2019)
8
-
9
- IMPROVEMENTS:
10
-
11
- * Clean up tweaks based on updates to rubocop. ([@TGWolf][])
12
-
13
- ## 1.0.1 (May 8, 2019)
14
-
15
- CHANGES:
16
-
17
- * Minor clean up of code, especially the CLI tool ([@TGWolf][])
18
-
19
- ## 1.0.0 (February 21, 2019)
20
-
21
- * Initial Release ([@TGWolf][])
22
-
23
- [@TGWolf]: https://github.com/TGWolf
data/CODEOWNERS DELETED
@@ -1,7 +0,0 @@
1
- # The codeowners file:
2
- #
3
- # For more information please read: https://help.github.com/articles/about-codeowners/
4
-
5
- # These owners will be the default owners for everything in
6
- # the repo. Unless a later match takes precedence,
7
- * @AntiPhotonltd/reviewers
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at tim.gurney@timgurney.net. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in ssl_expiry.gemspec
6
- gemspec
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2019 Tim Gurney aka Wolf
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "ssl_expiry"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/spec/spec_helper.rb DELETED
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/setup'
4
- require 'ssl_expiry'
5
-
6
- RSpec.configure do |config|
7
- # Enable flags like --only-failures and --next-failure
8
- config.example_status_persistence_file_path = '.rspec_status'
9
-
10
- # Disable RSpec exposing methods globally on `Module` and `main`
11
- config.disable_monkey_patching!
12
-
13
- config.expect_with :rspec do |c|
14
- c.syntax = :expect
15
- end
16
-
17
- original_stderr = $stderr
18
- original_stdout = $stdout
19
- config.before(:all) do
20
- # Redirect stderr and stdout
21
- $stderr = File.open(File::NULL, 'w')
22
- $stdout = File.open(File::NULL, 'w')
23
- end
24
- config.after(:all) do
25
- $stderr = original_stderr
26
- $stdout = original_stdout
27
- end
28
- end
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'ssl_expiry'
4
-
5
- RSpec.describe SSLExpiry do
6
- it 'has a version number' do
7
- expect(SSLExpiry::VERSION).not_to be nil
8
- end
9
- end
data/ssl_expiry.gemspec DELETED
@@ -1,31 +0,0 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "ssl_expiry/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "ssl_expiry"
8
- spec.version = SSLExpiry::VERSION
9
- spec.authors = ['Tim Gurney aka Wolf']
10
- spec.email = ['wolf@tgwolf.com']
11
-
12
- spec.summary = %q{A simple gem checking for ssl expiry.}
13
- spec.description = %q{A simple gem checking for ssl expiry.}
14
- spec.homepage = 'https://github.com/AntiPhotonltd/ssl_expiry'
15
- spec.license = "MIT"
16
-
17
- spec.files = `git ls-files`.split($/)
18
- spec.bindir = "exe"
19
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
- spec.require_paths = ["lib"]
21
-
22
- spec.add_development_dependency "bundler", ">= 1.17", "< 3.0"
23
- spec.add_development_dependency "rake", "~> 10.0"
24
- spec.add_development_dependency "rspec", "~> 3.0"
25
-
26
- spec.add_development_dependency 'openssl', '~> 2'
27
- spec.add_development_dependency 'net-http-persistent', '~> 3'
28
-
29
- spec.add_runtime_dependency 'openssl', '~> 2'
30
- spec.add_runtime_dependency 'net-http-persistent', '~> 3'
31
- end
data/testing/check-ssl DELETED
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
-
6
- require 'optparse'
7
- require 'ssl_expiry'
8
-
9
- # -------------------------------------------------------------------------------- #
10
- # Process Arguments #
11
- # -------------------------------------------------------------------------------- #
12
- # This function will process the input from the command line and work out what it #
13
- # is that the user wants to see. #
14
- # #
15
- # This is the main processing function where all the processing logic is handled. #
16
- # -------------------------------------------------------------------------------- #
17
-
18
- def process_arguments
19
- options = {}
20
- # Enforce the presence of
21
- mandatory = %I[domain]
22
-
23
- optparse = OptionParser.new do |opts|
24
- opts.banner = "Usage: #{$PROGRAM_NAME}"
25
-
26
- opts.on('-h', '--help', 'Display this screen') do
27
- puts opts
28
- exit(1)
29
- end
30
- opts.on('-d', '--domain string', 'The domain name to check') do |domain|
31
- options[:domain] = domain
32
- end
33
- end
34
-
35
- begin
36
- optparse.parse!
37
- options[:message] = ARGF.read unless STDIN.tty? # override message parameter if data is piped in
38
- missing = mandatory.select { |param| options[param].nil? }
39
- raise OptionParser::MissingArgument.new(missing.join(', ')) unless missing.empty?
40
- rescue OptionParser::InvalidOption, OptionParser::MissingArgument => e
41
- puts e.to_s
42
- puts optparse
43
- exit
44
- end
45
-
46
- results = SSLExpiry::SSLExpiry.check_certificates(options[:domain])
47
- SSLExpiry::SSLExpiry.display_results(results)
48
- end
49
-
50
- # -------------------------------------------------------------------------------- #
51
- # Main() #
52
- # -------------------------------------------------------------------------------- #
53
- # The main function where all of the heavy lifting and script config is done. #
54
- # -------------------------------------------------------------------------------- #
55
-
56
- def main
57
- process_arguments
58
- end
59
-
60
- main
61
-
62
- # -------------------------------------------------------------------------------- #
63
- # End of Script #
64
- # -------------------------------------------------------------------------------- #
65
- # This is the end - nothing more to see here. #
66
- # -------------------------------------------------------------------------------- #