Skip to content

Commit

Permalink
Remove tls_ca_certificates variable
Browse files Browse the repository at this point in the history
`tls_ca_certificates` is only used once and it may be that it is not
even used depending on the `if` condition. Instead of assign it, we can
just call the method when it is needed.

(cherry picked from commit 0a41598)
  • Loading branch information
Ana06 authored and michaelklishin committed Jun 5, 2018
1 parent 9e646f2 commit eee1859
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/bunny/transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ def prepare_tls_context(opts)
@tls_key = tls_key_from(opts)
@tls_certificate_store = opts[:tls_certificate_store]

@tls_ca_certificates = tls_ca_certificates_paths_from(opts)
@verify_peer = as_boolean(opts[:verify_ssl] || opts[:verify_peer] || opts[:verify])

@tls_context = initialize_tls_context(OpenSSL::SSL::SSLContext.new, opts)
Expand Down Expand Up @@ -416,7 +415,7 @@ def initialize_tls_context(ctx, opts={})
ctx.cert_store = if @tls_certificate_store
@tls_certificate_store
else
initialize_tls_certificate_store(@tls_ca_certificates)
initialize_tls_certificate_store(tls_ca_certificates_paths_from(opts))
end

if !@tls_certificate
Expand Down

0 comments on commit eee1859

Please sign in to comment.