fluent-plugin-ssl-check 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -2
- data/Gemfile.lock +1 -1
- data/fluent-plugin-ssl-check.gemspec +1 -1
- data/lib/fluent/plugin/in_ssl_check.rb +10 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd66e101f055ca5f4cf4d6ab29d548cb73df7783c9429171f03a397aaddd856f
|
4
|
+
data.tar.gz: 69fd54b23c4a88fa90565cf6bcb8d73990e96e0f42f869fd3fabf1ca16fa5f72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04500e488c04750d2f480037aa80feb16baf8d7a23b9b01f1921bbe201510b3b35a5694703da018a43705786af6d95ce67d7ee40fc0e661cd1df42823b640e4f
|
7
|
+
data.tar.gz: 13da4ca2dd02dd8c9a983570097cfa30b12b0f7e9dd0f573762d440c366fe0e0afc9b67deebf8c735dc87eaf52d8b1915dc3728b3179aa4d3686c5cc9a64c652
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -35,7 +35,8 @@ module Fluent
|
|
35
35
|
DEFAULT_TAG = NAME
|
36
36
|
DEFAULT_HOST = 'localhost'
|
37
37
|
DEFAULT_PORT = 443
|
38
|
-
|
38
|
+
DEFAULT_INTERVAL = 600
|
39
|
+
DEFAULT_SNI = true
|
39
40
|
DEFAULT_TIMEOUT = 5
|
40
41
|
DEFAULT_LOG_EVENTS = true
|
41
42
|
DEFAULT_METRIC_EVENTS = false
|
@@ -47,11 +48,13 @@ module Fluent
|
|
47
48
|
desc 'Host of the service to check'
|
48
49
|
config_param :hosts, :array, default: [], value_type: :string
|
49
50
|
desc 'Interval for the check execution'
|
50
|
-
config_param :interval, :time, default:
|
51
|
+
config_param :interval, :time, default: DEFAULT_INTERVAL
|
51
52
|
desc 'CA path to load'
|
52
53
|
config_param :ca_path, :string, default: nil
|
53
54
|
desc 'CA file to load'
|
54
55
|
config_param :ca_file, :string, default: nil
|
56
|
+
desc 'SNI support'
|
57
|
+
config_param :sni, :bool, default: DEFAULT_SNI
|
55
58
|
|
56
59
|
desc 'Timeout for check'
|
57
60
|
config_param :timeout, :integer, default: DEFAULT_TIMEOUT
|
@@ -104,7 +107,7 @@ module Fluent
|
|
104
107
|
ssl_client = SslClient.new(
|
105
108
|
host: host, port: port,
|
106
109
|
ca_path: ca_path, ca_file: ca_file,
|
107
|
-
timeout: timeout
|
110
|
+
sni: sni, timeout: timeout
|
108
111
|
)
|
109
112
|
ssl_client.ssl_info
|
110
113
|
end
|
@@ -211,13 +214,14 @@ module Fluent
|
|
211
214
|
# ssl client
|
212
215
|
# to check ssl status
|
213
216
|
class SslClient
|
214
|
-
attr_reader :host, :port, :ca_path, :ca_file, :timeout
|
217
|
+
attr_reader :host, :port, :ca_path, :ca_file, :sni, :timeout
|
215
218
|
|
216
|
-
def initialize(host:, port:, ca_path: nil, ca_file: nil, timeout: 5)
|
219
|
+
def initialize(host:, port:, ca_path: nil, ca_file: nil, sni: true, timeout: 5)
|
217
220
|
@host = host
|
218
221
|
@port = port
|
219
222
|
@ca_path = ca_path
|
220
223
|
@ca_file = ca_file
|
224
|
+
@sni = sni
|
221
225
|
@timeout = timeout
|
222
226
|
end
|
223
227
|
|
@@ -227,6 +231,7 @@ module Fluent
|
|
227
231
|
Timeout.timeout(timeout) do
|
228
232
|
tcp_socket = TCPSocket.open(host, port)
|
229
233
|
ssl_socket = OpenSSL::SSL::SSLSocket.new(tcp_socket, ssl_context)
|
234
|
+
ssl_socket.hostname = host if sni
|
230
235
|
ssl_socket.connect
|
231
236
|
ssl_socket.sysclose
|
232
237
|
tcp_socket.close
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-ssl-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Tych
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bump
|