Skip to content

Puma: Support SSL #18

@rolandjitsu

Description

@rolandjitsu

If I use Puma, how do I set up an ssl socket ? I looked over the code, somewhere among these lines:

args.push '--bind', "unix://#{@socket}"

inside the /forward/backends/puma.rb. I tried to see if I change the unix socket to a ssl if I send the ssl file and key:

attr_accessor :ssl
attr_accessor :ssl_key_file
attr_accessor :ssl_cert_file
attr_accessor :config_file

...

@application = options[:application]
@socket = options[:socket] || Heroku::Forward::Utils::Dir.tmp_filename('puma-', '.sock')
@env = options[:env] || 'development'
@config_file = options[:config_file]
@ssl = options[:ssl] || false
@ssl_key_file = options[:ssl_key_file] || false
@ssl_cert_file = options[:ssl_cert_file] || false

...

if @ssl
  args.push '--bind', "ssl://#{@socket}?key=#{@ssl_key_file}&cert=#{@ssl_cert_file}"
else
  args.push '--bind', "unix://#{@socket}"
end

But I get a /Users/rolandjitsu/Projects/Pulsr/vendor/bundle/gems/puma-2.8.1/lib/puma/binder.rb:225:ininitialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)` error.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions