fluent-plugin-syslog-gobi-tls 2.1.8 → 2.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-syslog-tls.gemspec +1 -1
- data/lib/syslog_tls/ssl_transport.rb +55 -15
- 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: e196efd2063d6ae5894d0f08837a7244f6f079e86253fb28e5622f53f3915d38
|
4
|
+
data.tar.gz: 6f63b49f7216216981e632f0f5449d76acd675c007bd775f51ca28ce32ac9926
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef2edc80b26fdf6122101671c2d1605419797420dad0e44ddabfabd94ef1dd514a91ae1aabb18bbe392da5ac9a51f2c1ef596977735e7f0da79cc68cf105b9a8
|
7
|
+
data.tar.gz: d64f19a16369c6aa59d97cb674c4824b6dc2ccf7b5553e17bd0f494a24f330c43867da9f2998481d2f7bfb305cad458ab8e7f22b3a41cbd8fe235e1728301999
|
@@ -19,7 +19,7 @@ require 'syslog_tls/version'
|
|
19
19
|
|
20
20
|
Gem::Specification.new do |s|
|
21
21
|
s.name = 'fluent-plugin-syslog-gobi-tls'
|
22
|
-
s.version = '2.1.
|
22
|
+
s.version = '2.1.15'
|
23
23
|
s.summary = %q{Fluent Syslog TLS output plugin}
|
24
24
|
s.authors = ['thomas morgan']
|
25
25
|
s.email = ['tm@iprog.com']
|
@@ -39,17 +39,27 @@ module SyslogTls
|
|
39
39
|
@verify_cert_name = verify_cert_name
|
40
40
|
@ssl_version = ssl_version
|
41
41
|
@retries = max_retries
|
42
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
43
|
+
puts "[#{timestamp}] in initialize: #{idle_timeout}"
|
42
44
|
connect
|
43
45
|
end
|
44
46
|
|
45
47
|
def connect
|
48
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
49
|
+
puts "[#{timestamp}] in connect"
|
46
50
|
@socket = get_ssl_connection
|
47
51
|
begin
|
48
52
|
begin
|
53
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
54
|
+
puts "[#{timestamp}] in connect doing connect_nonblock"
|
49
55
|
@socket.connect_nonblock
|
50
|
-
rescue Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable
|
56
|
+
rescue Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitReadable => e
|
57
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
58
|
+
puts "[#{timestamp}] in connect EAGAIN rescue: #{e.class} exception during #{type}: #{e.message} "
|
51
59
|
select_with_timeout(@socket, :connect_read) && retry
|
52
|
-
rescue IO::WaitWritable
|
60
|
+
rescue IO::WaitWritable => e
|
61
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
62
|
+
puts "[#{timestamp}] in connect WaitWritable rescue: #{e.class} exception during #{type}: #{e.message} "
|
53
63
|
select_with_timeout(@socket, :connect_write) && retry
|
54
64
|
end
|
55
65
|
rescue Errno::ETIMEDOUT
|
@@ -59,6 +69,8 @@ module SyslogTls
|
|
59
69
|
end
|
60
70
|
|
61
71
|
def get_tcp_connection
|
72
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
73
|
+
puts "[#{timestamp}] in get_tcp_connection"
|
62
74
|
tcp = nil
|
63
75
|
|
64
76
|
family = Socket::Constants::AF_UNSPEC
|
@@ -72,19 +84,34 @@ module SyslogTls
|
|
72
84
|
tcp.setsockopt(Socket::SOL_SOCKET, Socket::Constants::SO_REUSEADDR, true)
|
73
85
|
tcp.setsockopt(Socket::SOL_SOCKET, Socket::Constants::SO_REUSEPORT, true)
|
74
86
|
tcp.connect_nonblock(sock_addr)
|
75
|
-
rescue Errno::EINPROGRESS
|
76
|
-
|
77
|
-
|
78
|
-
#
|
79
|
-
#
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
87
|
+
rescue Errno::EINPROGRESS => e
|
88
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
89
|
+
puts "[#{timestamp}] in get_tcp_connection EINPROGRESS exception during TCP connection:"
|
90
|
+
puts "[#{timestamp}] Message: #{e.message}"
|
91
|
+
puts "[#{timestamp}] Backtrace: #{e.backtrace.join("\n")}"
|
92
|
+
|
93
|
+
select_with_timeout(tcp, :connect_write)
|
94
|
+
begin
|
95
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
96
|
+
puts "[#{timestamp}] in get_tcp_connection after select_with_timeout"
|
97
|
+
tcp.connect_nonblock(sock_addr)
|
98
|
+
rescue Errno::EISCONN
|
99
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
100
|
+
puts "[#{timestamp}] in get_tcp_connection in EISCONN"
|
101
|
+
# all good
|
102
|
+
rescue SystemCallError => e
|
103
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
104
|
+
puts "[#{timestamp}] in get_tcp_connection SystemCallError exception during TCP connection:"
|
105
|
+
puts "[#{timestamp}] Message: #{e.message}"
|
106
|
+
puts "[#{timestamp}] Backtrace: #{e.backtrace.join("\n")}"
|
107
|
+
tcp.close rescue nil
|
108
|
+
raise
|
86
109
|
end
|
87
|
-
rescue SystemCallError
|
110
|
+
rescue SystemCallError => e
|
111
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
112
|
+
puts "[#{timestamp}] in get_tcp_connection SystemCallError outer exception during TCP connection:"
|
113
|
+
puts "[#{timestamp}] Message: #{e.message}"
|
114
|
+
puts "[#{timestamp}] Backtrace: #{e.backtrace.join("\n")}"
|
88
115
|
tcp.close rescue nil
|
89
116
|
raise
|
90
117
|
end
|
@@ -94,6 +121,9 @@ module SyslogTls
|
|
94
121
|
end
|
95
122
|
|
96
123
|
def get_ssl_connection
|
124
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
125
|
+
puts "[#{timestamp}] in get_ssl_connection"
|
126
|
+
|
97
127
|
tcp = get_tcp_connection
|
98
128
|
|
99
129
|
ctx = OpenSSL::SSL::SSLContext.new
|
@@ -180,7 +210,17 @@ module SyslogTls
|
|
180
210
|
else
|
181
211
|
raise "Unknown select type #{type}"
|
182
212
|
end
|
183
|
-
|
213
|
+
begin
|
214
|
+
result = IO.select(*args) || raise("Socket timeout during #{type}")
|
215
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
216
|
+
puts "[#{timestamp}] in select_with_timeout: IO.select result during #{type}: #{result.inspect}"
|
217
|
+
# Code that may raise exceptions
|
218
|
+
rescue => e
|
219
|
+
# Catch all exceptions and log for testing/debugging
|
220
|
+
timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
221
|
+
puts "[#{timestamp}] Caught exception: #{e.class} - #{e.message}"
|
222
|
+
puts e.backtrace.join("\n")
|
223
|
+
end
|
184
224
|
end
|
185
225
|
|
186
226
|
# Forward any methods directly to SSLSocket
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-syslog-gobi-tls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thomas morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|