Skip to content

Segfault on missing Puma::MiniSSL::Context #key and #cert #828

@Zapotek

Description

@Zapotek

Hello,

I'm getting a segmentation fault when adding an SSL socket with a Puma::MiniSSL::Context that's missing #key and #cert on both Linux and Windows (tested on 64bit only).

require 'puma'

class HelloWorld
    def call( env )
        [
            200,
            {
                "Content-Type" => "text/html"
            },
            ["Hello World!"]
        ]
    end
end

server = Puma::Server.new( HelloWorld.new )
server.min_threads = 0
server.max_threads = 16

options = {
    bind: '0.0.0.0',
    port: 9999
}

ctx = Puma::MiniSSL::Context.new
server.binder.add_ssl_listener( options[:bind], options[:port], ctx )

puts  "Listening on https://#{options[:bind]}:#{options[:port]}"

begin
    server.run.join
rescue Interrupt => e
    server.stop( true )
end

Trigger with:

curl https://127.0.0.1:9999

Dump at: https://gist.github.com/Zapotek/c4ef4bed265793d72a94

I realise this the wrong setup, but failing gracefully would be preferable to a segfault.

Cheers,
Tasos L.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions