Skip to content

Commit

Permalink
Always use an SSL context. [Fixes #548]
Browse files Browse the repository at this point in the history
This reverts commit 9890b19, as latest
patch releases of 1.8.7 do accept an OpenSSL context object.

This has been broken since the refactoring d6e25e5,
which increased the scope of the original breakage.

Backports c7318a6 to 2-5-stable.

Closes #730
  • Loading branch information
ConradIrwin authored and jeremy committed May 22, 2017
1 parent f84b84d commit 63fb41b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/mail/network/delivery_methods/smtp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,11 @@ def ssl_context
openssl_verify_mode = "OpenSSL::SSL::VERIFY_#{openssl_verify_mode.upcase}".constantize
end

if RUBY_VERSION < '1.9.0'
openssl_verify_mode
else
context = Net::SMTP.default_ssl_context
context.verify_mode = openssl_verify_mode
context.ca_path = settings[:ca_path] if settings[:ca_path]
context.ca_file = settings[:ca_file] if settings[:ca_file]
context
end
context = Net::SMTP.default_ssl_context
context.verify_mode = openssl_verify_mode
context.ca_path = settings[:ca_path] if settings[:ca_path]
context.ca_file = settings[:ca_file] if settings[:ca_file]
context
end
end
end

0 comments on commit 63fb41b

Please sign in to comment.