bunny 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a2354707d0c6f725a8992baaff54c129113312407166c6c7275b6aef9c6d10b
4
- data.tar.gz: 5e0bfc1d60c0ccd0c0718fea83b537a4be5cca88c1c17795a7340d5fa39df168
3
+ metadata.gz: ca20b85fa97e5dfdf990bf45cbf000331d413a9aff294c121a788d7883a053bd
4
+ data.tar.gz: 69f78dded2ac65e651ba70baab933119b9cd80663a1bc0d5dae52767d01dae5c
5
5
  SHA512:
6
- metadata.gz: 85cda03336b6f4130335f39d5641054e8be776e2cb6a14291075954fa5364c62f631044c0a5364fd9473634e9680ed5a46331c1e8ec588470ea9281d0b5943bc
7
- data.tar.gz: 58f094229752eb2718345c078cb6ed2baa7f5642b59f37e211dd8f963e8543960ec0423fb3a7c4b0e7cb3c1a4daf6be1a747d14eb5b3a625b4abd8873d33b9fd
6
+ metadata.gz: 2b6bb72790ce461357e9934be10ae6a1b1d07744d835bed51c1add5502bbf4710ff9cc16e87e4b685b0fe31a9a8bd932dc00c6d9795cfc3f03ca6b03df6b0e40
7
+ data.tar.gz: 53978c476c2e712a4e624765fcd66ce5d4dd8cc99eeb364a244f26990d303ea3600d394db130db949040f0a76c59fc76657f6c2a714bb26bc45f84229c1cc5bb
data/ChangeLog.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## Changes between Bunny 3.3.0 and 3.4.0 (Sep 18, 2026)
2
+
3
+ ### Ruby 3.2 or Later Is Now Required
4
+
5
+ `required_ruby_version` was raised from `3.0` to `3.2`.
6
+
7
+ Ruby `3.0` and `3.1` have reached end of life and are no longer tested against.
8
+
9
+
10
+ ### Client Certificate Chains
11
+
12
+ If `tls_cert` points at a certificate bundle (chain), the entire chain will now be sent.
13
+
14
+ Previously only the first (leaf) certificate was sent, unintentionally.
15
+
16
+ Contributed by @eglitobias.
17
+
18
+ GitHub issues: [#749](https://github.com/ruby-amqp/bunny/issues/749), [#750](https://github.com/ruby-amqp/bunny/pull/750)
19
+
20
+
21
+ ### TLS Handshake Now Respects `connect_timeout`
22
+
23
+ A peer that accepted the TCP connection but never completed the TLS handshake
24
+ could block `Bunny::Session#start` indefinitely. The handshake now gives up after
25
+ `connect_timeout` and the connection fails over to the next endpoint.
26
+
27
+ This requires the `openssl` gem `3.3.0` or later.
28
+
29
+
1
30
  ## Changes between Bunny 3.2.0 and 3.3.0 (Aug 29, 2026)
2
31
 
3
32
  ### Passive Declarations No Longer Affect Topology Recovery
@@ -108,7 +108,12 @@ module Bunny
108
108
  def connect
109
109
  if uses_tls?
110
110
  begin
111
- @socket.connect
111
+ tls_handshake
112
+ rescue ClientTimeout => e
113
+ @logger.error { "TLS connection failed: #{e.message}" }
114
+ close
115
+ @status = :not_connected
116
+ raise Bunny::TCPConnectionFailed.new(e, self.hostname, self.port)
112
117
  rescue OpenSSL::SSL::SSLError => e
113
118
  @logger.error { "TLS connection failed: #{e.message}" }
114
119
  raise e
@@ -335,6 +340,17 @@ module Bunny
335
340
  @socket
336
341
  end
337
342
 
343
+ # Needs the openssl gem >= 3.3, which added SSLSocket#timeout= and made #connect honour it
344
+ def tls_handshake
345
+ previous_timeout = @socket.timeout
346
+ @socket.timeout = @connect_timeout if @connect_timeout
347
+ @socket.connect
348
+ rescue IO::TimeoutError
349
+ raise ClientTimeout, "TLS handshake timed out after #{@connect_timeout} seconds"
350
+ ensure
351
+ @socket.timeout = previous_timeout
352
+ end
353
+
338
354
  def maybe_initialize_socket
339
355
  initialize_socket if !@socket || closed?
340
356
  end
@@ -481,7 +497,12 @@ module Bunny
481
497
  end
482
498
 
483
499
  def initialize_tls_context(ctx, opts = {})
484
- ctx.cert = OpenSSL::X509::Certificate.new(@tls_certificate) if @tls_certificate
500
+ if @tls_certificate
501
+ leaf, *chain = OpenSSL::X509::Certificate.load(@tls_certificate)
502
+
503
+ ctx.cert = leaf
504
+ ctx.extra_chain_cert = chain unless chain.empty?
505
+ end
485
506
  ctx.key = OpenSSL::PKey.read(@tls_key) if @tls_key
486
507
  ctx.cert_store = if @tls_certificate_store
487
508
  @tls_certificate_store
data/lib/bunny/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "3.3.0"
5
+ VERSION = "3.4.0"
6
6
  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: 3.3.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Duncan
@@ -47,6 +47,20 @@ dependencies:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: '1.7'
50
+ - !ruby/object:Gem::Dependency
51
+ name: openssl
52
+ requirement: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '3.3'
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '3.3'
50
64
  - !ruby/object:Gem::Dependency
51
65
  name: sorted_set
52
66
  requirement: !ruby/object:Gem::Requirement
@@ -129,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
143
  requirements:
130
144
  - - ">="
131
145
  - !ruby/object:Gem::Version
132
- version: '3.0'
146
+ version: '3.2'
133
147
  required_rubygems_version: !ruby/object:Gem::Requirement
134
148
  requirements:
135
149
  - - ">="