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:
parent
148110e70c
commit
9a3fb1f43b
1 changed files with 6 additions and 3 deletions
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
require "net/http"
|
require "net/http"
|
||||||
require "uri"
|
require "uri"
|
||||||
require "openssl"
|
|
||||||
|
|
||||||
module ActionMailbox
|
module ActionMailbox
|
||||||
class PostfixRelayer
|
class PostfixRelayer
|
||||||
|
@ -49,8 +48,12 @@ module ActionMailbox
|
||||||
|
|
||||||
def client
|
def client
|
||||||
@client ||= Net::HTTP.new(uri.host, uri.port).tap do |connection|
|
@client ||= Net::HTTP.new(uri.host, uri.port).tap do |connection|
|
||||||
connection.use_ssl = uri.scheme == "https"
|
if uri.scheme == "https"
|
||||||
|
require "openssl"
|
||||||
|
|
||||||
|
connection.use_ssl = true
|
||||||
connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
||||||
|
end
|
||||||
|
|
||||||
connection.open_timeout = 1
|
connection.open_timeout = 1
|
||||||
connection.read_timeout = 10
|
connection.read_timeout = 10
|
||||||
|
|
Loading…
Reference in a new issue