Project

General

Profile

Actions

Improvement #1761

closed

Allow SSL context to be configured via settings

Added by liaham over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Compatible Redmine Version:

Description

Rails ActionMailer uses the ruby gem mail which again supports to set up the ssl context for smtp:

# mail/lib/mail/network/delivery_methods/smtp.rb

# Allow SSL context to be configured via settings, for Ruby >= 1.9
# Just returns openssl verify mode for Ruby 1.8.x
  def ssl_context
    openssl_verify_mode = settings[:openssl_verify_mode]

    if openssl_verify_mode.kind_of?(String)
      openssl_verify_mode = OpenSSL::SSL.const_get("VERIFY_#{openssl_verify_mode.upcase}")
    end

    context = Net::SMTP.default_ssl_context
    context.verify_mode = openssl_verify_mode if 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

Therefore, ca_path and ca_file should be supported by rails too.

The config/configuration.yml and config/env.yml should be extended accordingly.


Subtasks 1 (0 open1 closed)

Maintenance #1762: Update MakefileClosedliaham

Actions
Actions

Also available in: Atom PDF