1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Load OpenSSL only when it's used

This commit is contained in:
George Claghorn 2018-11-25 18:31:36 -05:00
parent 148110e70c
commit 9a3fb1f43b

View file

@ -2,7 +2,6 @@
require "net/http"
require "uri"
require "openssl"
module ActionMailbox
class PostfixRelayer
@ -49,8 +48,12 @@ module ActionMailbox
def client
@client ||= Net::HTTP.new(uri.host, uri.port).tap do |connection|
connection.use_ssl = uri.scheme == "https"
connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
if uri.scheme == "https"
require "openssl"
connection.use_ssl = true
connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
end
connection.open_timeout = 1
connection.read_timeout = 10