Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Zapotek opened this issue Nov 20, 2015 · 0 comments
Closed

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

Zapotek opened this issue Nov 20, 2015 · 0 comments

Comments

@Zapotek
Copy link

Zapotek commented Nov 20, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant