excon 0.23.0 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of excon might be problematic. Click here for more details.
- data/Gemfile.lock +1 -1
- data/changelog.txt +5 -0
- data/excon.gemspec +2 -2
- data/lib/excon/constants.rb +3 -1
- data/lib/excon/ssl_socket.rb +10 -3
- data/tests/basic_tests.rb +37 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/changelog.txt
CHANGED
data/excon.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'excon'
|
16
|
-
s.version = '0.
|
17
|
-
s.date = '2013-06-
|
16
|
+
s.version = '0.24.0'
|
17
|
+
s.date = '2013-06-12'
|
18
18
|
s.rubyforge_project = 'excon'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
data/lib/excon/constants.rb
CHANGED
@@ -35,6 +35,8 @@ module Excon
|
|
35
35
|
:chunk_size,
|
36
36
|
:client_key,
|
37
37
|
:client_cert,
|
38
|
+
:certificate,
|
39
|
+
:private_key,
|
38
40
|
:connect_timeout,
|
39
41
|
:connection,
|
40
42
|
:debug_request,
|
@@ -75,7 +77,7 @@ module Excon
|
|
75
77
|
:write_timeout
|
76
78
|
]
|
77
79
|
|
78
|
-
VERSION = '0.
|
80
|
+
VERSION = '0.24.0'
|
79
81
|
|
80
82
|
unless ::IO.const_defined?(:WaitReadable)
|
81
83
|
class ::IO
|
data/lib/excon/ssl_socket.rb
CHANGED
@@ -24,9 +24,16 @@ module Excon
|
|
24
24
|
ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
25
25
|
end
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
# maintain existing API
|
28
|
+
certificate_path = @data[:client_cert] || @data[:certificate_path]
|
29
|
+
private_key_path = @data[:client_key] || @data[:private_key_path]
|
30
|
+
|
31
|
+
if certificate_path && private_key_path
|
32
|
+
ssl_context.cert = OpenSSL::X509::Certificate.new(File.read(certificate_path))
|
33
|
+
ssl_context.key = OpenSSL::PKey::RSA.new(File.read(private_key_path))
|
34
|
+
elsif @data.has_key?(:certificate) && @data.has_key?(:private_key)
|
35
|
+
ssl_context.cert = OpenSSL::X509::Certificate.new(@data[:certificate])
|
36
|
+
ssl_context.key = OpenSSL::PKey::RSA.new(@data[:private_key])
|
30
37
|
end
|
31
38
|
|
32
39
|
if @data[:proxy]
|
data/tests/basic_tests.rb
CHANGED
@@ -52,7 +52,7 @@ with_rackup('ssl.ru') do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
with_rackup('ssl_verify_peer.ru') do
|
55
|
-
Shindo.tests('Excon basics (ssl)',['focus']) do
|
55
|
+
Shindo.tests('Excon basics (ssl file)',['focus']) do
|
56
56
|
connection = Excon::Connection.new({
|
57
57
|
:host => '127.0.0.1',
|
58
58
|
:nonblock => false,
|
@@ -69,5 +69,41 @@ with_rackup('ssl_verify_peer.ru') do
|
|
69
69
|
:client_key => File.join(File.dirname(__FILE__), 'data', 'excon.cert.key'),
|
70
70
|
:client_cert => File.join(File.dirname(__FILE__), 'data', 'excon.cert.crt')
|
71
71
|
)
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
Shindo.tests('Excon basics (ssl file paths)',['focus']) do
|
76
|
+
connection = Excon::Connection.new({
|
77
|
+
:host => '127.0.0.1',
|
78
|
+
:nonblock => false,
|
79
|
+
:port => 8443,
|
80
|
+
:scheme => 'https',
|
81
|
+
:ssl_verify_peer => false
|
82
|
+
})
|
83
|
+
|
84
|
+
tests('GET /content-length/100').raises(Excon::Errors::SocketError) do
|
85
|
+
connection.request(:method => :get, :path => '/content-length/100')
|
86
|
+
end
|
87
|
+
|
88
|
+
basic_tests('https://127.0.0.1:8443',
|
89
|
+
:private_key_path => File.join(File.dirname(__FILE__), 'data', 'excon.cert.key'),
|
90
|
+
:certificate_path => File.join(File.dirname(__FILE__), 'data', 'excon.cert.crt')
|
91
|
+
)
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
Shindo.tests('Excon basics (ssl string)', ['focus']) do
|
96
|
+
connection = Excon::Connection.new({
|
97
|
+
:host => '127.0.0.1',
|
98
|
+
:nonblock => false,
|
99
|
+
:port => 8443,
|
100
|
+
:scheme => 'https',
|
101
|
+
:ssl_verify_peer => false
|
102
|
+
})
|
103
|
+
|
104
|
+
basic_tests('https://127.0.0.1:8443',
|
105
|
+
:private_key => File.read(File.join(File.dirname(__FILE__), 'data', 'excon.cert.key')),
|
106
|
+
:certificate => File.read(File.join(File.dirname(__FILE__), 'data', 'excon.cert.crt'))
|
107
|
+
)
|
72
108
|
end
|
73
109
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.24.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-06-
|
14
|
+
date: 2013-06-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -235,7 +235,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
235
235
|
version: '0'
|
236
236
|
segments:
|
237
237
|
- 0
|
238
|
-
hash: -
|
238
|
+
hash: -4031892834274388538
|
239
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
240
|
none: false
|
241
241
|
requirements:
|