bunny 0.10.3 → 0.10.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad9161e606b40789a56997ff7b9b3d81f61c3d28
4
- data.tar.gz: 22ecc57943938dcefc1fa6d798470d985b61f3ba
3
+ metadata.gz: b9c9bf09dd970ef5209cce72c05a7d73f82f4750
4
+ data.tar.gz: d658fe0aea0c6f3461b2f4d1c54db3b7d8c0f9a6
5
5
  SHA512:
6
- metadata.gz: 88fe8294f3572a9f6f9c7badaf0e92428c0320ba1b9c6d4b2d10c12cb947ce606baa77ab090d73b272e4826ef16122fb0c2d8ef1fb69d5c71c46bf421f8f5e75
7
- data.tar.gz: 6d9c2b5e8acb8012a719787c2e410972e981bea80902905f409ba433a74af866217b3ccc61e17ba33f4d47b3deb9f21d604c514cc20888a468c23fbc26d5b614
6
+ metadata.gz: 220ac2fd8093683bfdb6b6c614b8198a47a996295804bd677d3aebfa6001eb1e5dfd7ad63b359e98050fb285f680c0ba5867b9a7f88d2437487db81cc25e84c1
7
+ data.tar.gz: a59a8fce37f7807548223b15041d349f5ec8522342427277cebb2de729a0927fde4fb660e5b4ea869b3abd395610e5bc9d3844e126f4d8d7476ce260f0cbae1a
@@ -1,3 +1,13 @@
1
+ ## Changes between Bunny 0.10.3 and 0.10.4
2
+
3
+ ### Default Paths for TLS/SSL CA's on All OS'es
4
+
5
+ Bunny now uses OpenSSL to detect default TLS/SSL CA's paths, extending
6
+ this feature to OS'es other than Linux.
7
+
8
+ Contributed by Jingwen Owen Ou.
9
+
10
+
1
11
  ## Changes between Bunny 0.10.2 and 0.10.3
2
12
 
3
13
  ### Default Paths for TLS/SSL CA's on Linux
@@ -41,11 +41,14 @@ module Bunny
41
41
  @tls_certificate = opts[:tls_certificate] || opts[:ssl_cert_string]
42
42
  @tls_key = opts[:tls_key] || opts[:ssl_key_string]
43
43
  @tls_certificate_store = opts[:tls_certificate_store]
44
+
45
+ default_ca_file = ENV[OpenSSL::X509::DEFAULT_CERT_FILE_ENV] || OpenSSL::X509::DEFAULT_CERT_FILE
46
+ default_ca_path = ENV[OpenSSL::X509::DEFAULT_CERT_DIR_ENV] || OpenSSL::X509::DEFAULT_CERT_DIR
44
47
  @tls_ca_certificates = opts.fetch(:tls_ca_certificates, [
45
- '/etc/ssl/certs/ca-certificates.crt', # Ubuntu/Debian
46
- '/etc/ssl/certs/ca-bundle.crt', # Amazon Linux
47
- '/etc/ssl/ca-bundle.pem', # OpenSUSE
48
- '/etc/pki/tls/certs/ca-bundle.crt' # Fedora/RHEL
48
+ default_ca_file,
49
+ File.join(default_ca_path, 'ca-certificates.crt'), # Ubuntu/Debian
50
+ File.join(default_ca_path, 'ca-bundle.crt'), # Amazon Linux & Fedora/RHEL
51
+ File.join(default_ca_path, 'ca-bundle.pem') # OpenSUSE
49
52
  ])
50
53
  @verify_peer = opts[:verify_ssl] || opts[:verify_peer]
51
54
 
@@ -345,6 +348,7 @@ module Bunny
345
348
 
346
349
  def initialize_tls_certificate_store(certs)
347
350
  certs = certs.select { |path| File.readable? path }
351
+ @logger.debug "Using CA certificates at #{certs.join(', ')}"
348
352
  if certs.empty?
349
353
  @logger.error "No CA certificates found, add one with :tls_ca_certificates"
350
354
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "0.10.3"
5
+ VERSION = "0.10.4"
6
6
  end
@@ -86,4 +86,46 @@ unless ENV["CI"]
86
86
  ch.close
87
87
  end
88
88
  end
89
+
90
+
91
+ describe "TLS connection to RabbitMQ with a connection string" do
92
+ let(:connection) do
93
+ c = Bunny.new("amqps://bunny_gem:bunny_password@127.0.0.1/bunny_testbed",
94
+ :tls_cert => "spec/tls/client_cert.pem",
95
+ :tls_key => "spec/tls/client_key.pem",
96
+ :tls_ca_certificates => ["./spec/tls/cacert.pem"])
97
+ c.start
98
+ c
99
+ end
100
+
101
+ after :each do
102
+ connection.close
103
+ end
104
+
105
+ it "provides the same API as a regular connection" do
106
+ connection.should be_tls
107
+ ch = connection.create_channel
108
+
109
+ q = ch.queue("", :exclusive => true)
110
+ x = ch.default_exchange
111
+
112
+ x.publish("xyzzy", :routing_key => q.name).
113
+ publish("xyzzy", :routing_key => q.name).
114
+ publish("xyzzy", :routing_key => q.name).
115
+ publish("xyzzy", :routing_key => q.name)
116
+
117
+ sleep 0.5
118
+ q.message_count.should == 4
119
+
120
+ i = 0
121
+ q.subscribe do |delivery_info, _, payload|
122
+ i += 1
123
+ end
124
+ sleep 1.0
125
+ i.should == 4
126
+ q.message_count.should == 0
127
+
128
+ ch.close
129
+ end
130
+ end
89
131
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Duncan