le 2.6.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/LE.gemspec +1 -1
  3. data/lib/le/host/http.rb +18 -33
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89ee711adf3ed85bc5e76210ee63f1d099431b6c
4
- data.tar.gz: 276d832683ea7c659cb1f212b89043379aad50b6
3
+ metadata.gz: 52e03289c94d2fc2c851d1a87b51de145fda60dc
4
+ data.tar.gz: 9b851583326682eb751da5bd2063dfa665962151
5
5
  SHA512:
6
- metadata.gz: 8f5e0e09b3647a84205a5d20b0a580348aaed0d0d2fcbb1df54c5aad818175628346ff41beb4798643c76e0521e1487c29951c978cf182b1e165a892c2777bf4
7
- data.tar.gz: 7d04ea50400e63f0cd58c3013a25a6ff1905dfc1a11fd0991fc40e93a01742702cfe2e0dde76c81f93106cec5327f4b23884c208da40770dd265a7153cce9795
6
+ metadata.gz: 04c28e2d32b3e1b3e06f0556c8e860446cfa229f9e3ff955eb30b29129c52d78df4cff0058bdf1a210fdf099c85c15dab54da5ae9f9b200a7d2ef0bd8bfa9ca7
7
+ data.tar.gz: c349ed69aaf02b4b673ff2dce8dcf656df4374d90c06ace34912ab43fb507fcbce1277978d5caf4c4814f044896210b1b5116a1e04911e482e890192413e20e1
data/LE.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'le'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "le"
8
- gem.version = "2.6.0"
8
+ gem.version = "2.6.1"
9
9
  gem.date = Time.now
10
10
  gem.summary = "Logentries plugin"
11
11
  gem.licenses = ["MIT"]
@@ -1,6 +1,7 @@
1
1
  require 'socket'
2
2
  require 'openssl'
3
3
  require 'thread'
4
+ require 'timeout'
4
5
  require 'uri'
5
6
 
6
7
  module Le
@@ -12,37 +13,6 @@ module Le
12
13
 
13
14
  API_PORT = 10000
14
15
  API_SSL_POR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JQQW
31
- MBQGCCsGAQUFBwMBBggrBgEFBQcDAjAdBgNVHREEFjAUghJhcGkubG9nZW50cmll
32
- cy5jb20wQQYDVR0fBDowODA2oDSgMoYwaHR0cDovL2d0c3NsZHYtY3JsLmdlb3Ry
33
- dXN0LmNvbS9jcmxzL2d0c3NsZHYuY3JsMB0GA1UdDgQWBBRowYR/aaGeiRRQxbaV
34
- 1PI8hS4m9jAMBgNVHRMBAf8EAjAAMHUGCCsGAQUFBwEBBGkwZzAsBggrBgEFBQcw
35
- AYYgaHR0cDovL2d0c3NsZHYtb2NzcC5nZW90cnVzdC5jb20wNwYIKwYBBQUHMAKG
36
- K2h0dHA6Ly9ndHNzbGR2LWFpYS5nZW90cnVzdC5jb20vZ3Rzc2xkdi5jcnQwTAYD
37
- VR0gBEUwQzBBBgpghkgBhvhFAQc2MDMwMQYIKwYBBQUHAgEWJWh0dHA6Ly93d3cu
38
- Z2VvdHJ1c3QuY29tL3Jlc291cmNlcy9jcHMwDQYJKoZIhvcNAQEFBQADggEBAAzx
39
- g9JKztRmpItki8XQoGHEbopDIDMmn4Q7s9k7L9nT5gn5XCXdIHnsSe8+/2N7tW4E
40
- iHEEWC5G6Q16FdXBwKjW2LrBKaP7FCRcqXJSI+cfiuk0uywkGBTXpqBVClQRzypd
41
- 9vZONyFFlLGUwUC1DFVxe7T77Dv+pOPuJ7qSfcVUnVtzpLMMWJsDG6NHpy0JhsS9
42
- wVYQgpYWRRZ7bJyfRCJxzIdYF3qy/P9NWyZSlDUuv11s1GSFO2pNd34p59GacVAL
43
- BJE6y5eOPTSbtkmBW/ukaVYdI5NLXNer3IaK3fetV3LvYGOaX8hR45FI1pvyKYvf
44
- S5ol3bQmY1mv78XKkOk=
45
- -----END CERTIFICATE-----'
46
16
  SHUTDOWN_COMMAND = "DIE!DIE!" # magic command string for async worker to shutdown
47
17
  SHUTDOWN_MAX_WAIT = 10 # max seconds to wait for queue to clear on shutdown
48
18
  SHUTDOWN_WAIT_STEP = 0.2 # sleep duration (seconds) while waiting to shutdown
@@ -215,11 +185,26 @@ S5ol3bQmY1mv78XKkOk=
215
185
  socket = TCPSocket.new(host, port)
216
186
 
217
187
  if @ssl
188
+ cert_store = OpenSSL::X509::Store.new
189
+ cert_store.set_default_paths
190
+
218
191
  ssl_context = OpenSSL::SSL::SSLContext.new()
219
- ssl_context.cert = OpenSSL::X509::Certificate.new(API_CERT)
192
+ ssl_context.cert_store = cert_store
193
+
194
+ ssl_version_candidates = [:TLSv1_2, :TLSv1_1, :TLSv1]
195
+ ssl_version_candidates = ssl_version_candidates.select { |version| OpenSSL::SSL::SSLContext::METHODS.include? version }
196
+ if ssl_version_candidates.empty?
197
+ raise "Could not find suitable TLS version"
198
+ end
199
+ # currently we only set the version when we have no choice
200
+ ssl_context.ssl_version = ssl_version_candidates[0] if ssl_version_candidates.length == 1
201
+ ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER
220
202
  ssl_socket = OpenSSL::SSL::SSLSocket.new(socket, ssl_context)
203
+ ssl_socket.hostname = host if ssl_socket.respond_to?(:hostname=)
221
204
  ssl_socket.sync_close = true
222
- ssl_socket.connect
205
+ Timeout::timeout(10) do
206
+ ssl_socket.connect
207
+ end
223
208
  @conn = ssl_socket
224
209
  else
225
210
  @conn = socket
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: le
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Lacomber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-14 00:00:00.000000000 Z
11
+ date: 2014-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler