Class: Puma::Plugin::SSLocal

Inherits:
Object
  • Object
show all
Defined in:
lib/puma/plugin/sslocal.rb

Instance Method Summary collapse

Constructor Details

#initialize(_loader = nil) ⇒ SSLocal

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



12
# File 'lib/puma/plugin/sslocal.rb', line 12

def initialize(_loader = nil); end

Instance Method Details

#config(_dsl) ⇒ Object

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.



18
# File 'lib/puma/plugin/sslocal.rb', line 18

def config(_dsl); end

#start(launcher) ⇒ Object

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.



24
25
26
27
28
29
30
# 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