class Puma::Plugin::SSLocal

Public Class Methods

new(_loader = nil) click to toggle source

Puma 4.x supplies an argument, but 5.x does not. We don't need it either way.

# File lib/puma/plugin/sslocal.rb, line 12
def initialize(_loader = nil); end

Public Instance Methods

config(_dsl) click to toggle source

We don't actually want to modify the configuration here, as it only impacts the file_config values. user_config values take precedence, and the only way to cleanly impact those is via the launcher object supplied in the `start` call.

# File lib/puma/plugin/sslocal.rb, line 18
def config(_dsl); end
start(launcher) click to toggle source

User-provided configuration (command-line arguments, environment variables) take precedence over file-provided configuration (such as in config/puma.rb). If there are certificate files present, we want each configuration to use SSL if appropriate, so we rebind each one.

# File lib/puma/plugin/sslocal.rb, line 24
def start(launcher)
  launcher.config.configure do |user_config, file_config, default_config|
    ::SSLocal::PumaRebinder.call(user_config)
    ::SSLocal::PumaRebinder.call(file_config)
    ::SSLocal::PumaRebinder.call(default_config)
  end
end