bunny 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog.md +16 -0
- data/lib/bunny/transport.rb +12 -2
- data/lib/bunny/version.rb +1 -1
- data/spec/higher_level_api/integration/tls_connection_spec.rb +43 -1
- metadata +14 -23
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6bf2e653c0def6db325c55467b9aadc29cd1a95c
|
4
|
+
data.tar.gz: e842ff44b84872269ff66ab83d1cf9f46fab5708
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c526be96cb7740a54e13657302c3628abf86f8165f722ad44b55cf3d3a94b0bbeddaf603143ed7f572c3c595871104bcdecad916f318cc28951aec392db5de35
|
7
|
+
data.tar.gz: 7d60dbc8c64568343d913d4c03f8f142ef0ed8b4daea45197ecf73a4c8192af61bb19bf9afd9700ac3aea587b8740c73ea6f95b58add6bbcb1dfa7f5637e9d0b
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
## Changes between Bunny 0.9.4 and 0.9.5
|
2
|
+
|
3
|
+
No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Changes between Bunny 0.9.3 and 0.9.4
|
7
|
+
|
8
|
+
### Client TLS Certificates are Optional
|
9
|
+
|
10
|
+
Bunny will no longer require client TLS certificates. Note that CA certificate
|
11
|
+
list is still necessary.
|
12
|
+
|
13
|
+
If RabbitMQ TLS configuration requires peer verification, client certificate
|
14
|
+
and private key are mandatory.
|
15
|
+
|
16
|
+
|
1
17
|
## Changes between Bunny 0.9.2 and 0.9.3
|
2
18
|
|
3
19
|
### Publishing Over Closed Connections
|
data/lib/bunny/transport.rb
CHANGED
@@ -311,14 +311,24 @@ module Bunny
|
|
311
311
|
end
|
312
312
|
|
313
313
|
def initialize_tls_context(ctx)
|
314
|
-
ctx.cert = OpenSSL::X509::Certificate.new(@tls_certificate)
|
315
|
-
ctx.key = OpenSSL::PKey::RSA.new(@tls_key)
|
314
|
+
ctx.cert = OpenSSL::X509::Certificate.new(@tls_certificate) if @tls_certificate
|
315
|
+
ctx.key = OpenSSL::PKey::RSA.new(@tls_key) if @tls_key
|
316
316
|
ctx.cert_store = if @tls_certificate_store
|
317
317
|
@tls_certificate_store
|
318
318
|
else
|
319
319
|
initialize_tls_certificate_store(@tls_ca_certificates)
|
320
320
|
end
|
321
321
|
|
322
|
+
if !@tls_certificate
|
323
|
+
@logger.warn <<-MSG
|
324
|
+
Using TLS but no client certificate is provided! If RabbitMQ is configured to verify peer
|
325
|
+
certificate, connection upgrade will fail!
|
326
|
+
MSG
|
327
|
+
end
|
328
|
+
if @tls_certificate && !@tls_key
|
329
|
+
@logger.warn "Using TLS but no client private key is provided!"
|
330
|
+
end
|
331
|
+
|
322
332
|
# setting TLS/SSL version only works correctly when done
|
323
333
|
# vis set_params. MK.
|
324
334
|
ctx.set_params(:ssl_version => @opts.fetch(:tls_protocol, DEFAULT_TLS_PROTOCOL))
|
data/lib/bunny/version.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
require "spec_helper"
|
3
3
|
|
4
4
|
unless ENV["CI"]
|
5
|
-
describe "TLS connection to RabbitMQ" do
|
5
|
+
describe "TLS connection to RabbitMQ with client certificates" do
|
6
6
|
let(:connection) do
|
7
7
|
c = Bunny.new(:user => "bunny_gem",
|
8
8
|
:password => "bunny_password",
|
@@ -44,4 +44,46 @@ unless ENV["CI"]
|
|
44
44
|
ch.close
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
|
49
|
+
describe "TLS connection to RabbitMQ without client certificates" do
|
50
|
+
let(:connection) do
|
51
|
+
c = Bunny.new(:user => "bunny_gem",
|
52
|
+
:password => "bunny_password",
|
53
|
+
:vhost => "bunny_testbed",
|
54
|
+
:tls => true,
|
55
|
+
:tls_ca_certificates => ["./spec/tls/cacert.pem"])
|
56
|
+
c.start
|
57
|
+
c
|
58
|
+
end
|
59
|
+
|
60
|
+
after :all do
|
61
|
+
connection.close
|
62
|
+
end
|
63
|
+
|
64
|
+
it "provides the same API as a regular connection" do
|
65
|
+
ch = connection.create_channel
|
66
|
+
|
67
|
+
q = ch.queue("", :exclusive => true)
|
68
|
+
x = ch.default_exchange
|
69
|
+
|
70
|
+
x.publish("xyzzy", :routing_key => q.name).
|
71
|
+
publish("xyzzy", :routing_key => q.name).
|
72
|
+
publish("xyzzy", :routing_key => q.name).
|
73
|
+
publish("xyzzy", :routing_key => q.name)
|
74
|
+
|
75
|
+
sleep 0.5
|
76
|
+
q.message_count.should == 4
|
77
|
+
|
78
|
+
i = 0
|
79
|
+
q.subscribe do |delivery_info, _, payload|
|
80
|
+
i += 1
|
81
|
+
end
|
82
|
+
sleep 1.0
|
83
|
+
i.should == 4
|
84
|
+
q.message_count.should == 0
|
85
|
+
|
86
|
+
ch.close
|
87
|
+
end
|
88
|
+
end
|
47
89
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bunny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
5
|
-
prerelease:
|
4
|
+
version: 0.9.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Chris Duncan
|
@@ -13,36 +12,29 @@ authors:
|
|
13
12
|
autorequire:
|
14
13
|
bindir: bin
|
15
14
|
cert_chain: []
|
16
|
-
date: 2013-07-
|
15
|
+
date: 2013-07-25 00:00:00.000000000 Z
|
17
16
|
dependencies:
|
18
17
|
- !ruby/object:Gem::Dependency
|
19
18
|
name: amq-protocol
|
20
19
|
requirement: !ruby/object:Gem::Requirement
|
21
|
-
none: false
|
22
20
|
requirements:
|
23
|
-
- -
|
21
|
+
- - '>='
|
24
22
|
- !ruby/object:Gem::Version
|
25
23
|
version: 1.6.0
|
26
24
|
type: :runtime
|
27
25
|
prerelease: false
|
28
26
|
version_requirements: !ruby/object:Gem::Requirement
|
29
|
-
none: false
|
30
27
|
requirements:
|
31
|
-
- -
|
28
|
+
- - '>='
|
32
29
|
- !ruby/object:Gem::Version
|
33
30
|
version: 1.6.0
|
34
31
|
description: Easy to use, feature complete Ruby client for RabbitMQ 2.0.
|
35
32
|
email:
|
36
|
-
-
|
37
|
-
|
38
|
-
-
|
39
|
-
|
40
|
-
-
|
41
|
-
c3Rhc3RueUAxMDFpZGVhcy5jeg==
|
42
|
-
- !binary |-
|
43
|
-
bWljaGFlbEBub3ZlbWJlcmFpbi5jb20=
|
44
|
-
- !binary |-
|
45
|
-
c2thZXNAcmFpbHNleHByZXNzLmRl
|
33
|
+
- celldee@gmail.com
|
34
|
+
- eric@5stops.com
|
35
|
+
- stastny@101ideas.cz
|
36
|
+
- michael@novemberain.com
|
37
|
+
- skaes@railsexpress.de
|
46
38
|
executables: []
|
47
39
|
extensions: []
|
48
40
|
extra_rdoc_files:
|
@@ -192,27 +184,26 @@ files:
|
|
192
184
|
homepage: http://rubybunny.info
|
193
185
|
licenses:
|
194
186
|
- MIT
|
187
|
+
metadata: {}
|
195
188
|
post_install_message:
|
196
189
|
rdoc_options: []
|
197
190
|
require_paths:
|
198
191
|
- lib
|
199
192
|
required_ruby_version: !ruby/object:Gem::Requirement
|
200
|
-
none: false
|
201
193
|
requirements:
|
202
|
-
- -
|
194
|
+
- - '>='
|
203
195
|
- !ruby/object:Gem::Version
|
204
196
|
version: '0'
|
205
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
|
-
none: false
|
207
198
|
requirements:
|
208
|
-
- -
|
199
|
+
- - '>='
|
209
200
|
- !ruby/object:Gem::Version
|
210
201
|
version: '0'
|
211
202
|
requirements: []
|
212
203
|
rubyforge_project:
|
213
|
-
rubygems_version:
|
204
|
+
rubygems_version: 2.0.5
|
214
205
|
signing_key:
|
215
|
-
specification_version:
|
206
|
+
specification_version: 4
|
216
207
|
summary: Popular easy to use Ruby client for RabbitMQ
|
217
208
|
test_files:
|
218
209
|
- spec/compatibility/queue_declare_spec.rb
|