le 2.6.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LE.gemspec +1 -1
- data/lib/le/host/http.rb +18 -33
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52e03289c94d2fc2c851d1a87b51de145fda60dc
|
4
|
+
data.tar.gz: 9b851583326682eb751da5bd2063dfa665962151
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04c28e2d32b3e1b3e06f0556c8e860446cfa229f9e3ff955eb30b29129c52d78df4cff0058bdf1a210fdf099c85c15dab54da5ae9f9b200a7d2ef0bd8bfa9ca7
|
7
|
+
data.tar.gz: c349ed69aaf02b4b673ff2dce8dcf656df4374d90c06ace34912ab43fb507fcbce1277978d5caf4c4814f044896210b1b5116a1e04911e482e890192413e20e1
|
data/LE.gemspec
CHANGED
data/lib/le/host/http.rb
CHANGED
@@ -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_PORT = 20000
|
15
|
-
API_CERT = '-----BEGIN CERTIFICATE-----
|
16
|
-
MIIFSjCCBDKgAwIBAgIDCQpNMA0GCSqGSIb3DQEBBQUAMGExCzAJBgNVBAYTAlVT
|
17
|
-
MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMR0wGwYDVQQLExREb21haW4gVmFsaWRh
|
18
|
-
dGVkIFNTTDEbMBkGA1UEAxMSR2VvVHJ1c3QgRFYgU1NMIENBMB4XDTE0MDQxNTEz
|
19
|
-
NTcxNVoXDTE2MDkxMzA0M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GeiRRQxbaV
|
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
|
-
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2014-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|