diff --git a/lib/puma/minissl/context_builder.rb b/lib/puma/minissl/context_builder.rb index dade2e1842..866108ed9b 100644 --- a/lib/puma/minissl/context_builder.rb +++ b/lib/puma/minissl/context_builder.rb @@ -38,7 +38,7 @@ def context ctx.keystore_pass = params['keystore-pass'] ctx.ssl_cipher_list = params['ssl_cipher_list'] if params['ssl_cipher_list'] else - unless params['key'] + if params['key'].nil? || params['key'] == "" if localhost_authority params['key'] = localhost_authority_context[0] else @@ -48,7 +48,7 @@ def context ctx.key = params['key'] - unless params['cert'] + if params['cert'].nil? || params['cert'] == "" if localhost_authority params['cert'] = localhost_authority_context[1] else diff --git a/test/test_integration_ssl.rb b/test/test_integration_ssl.rb index 8f746e5ab7..436dd05a8d 100644 --- a/test/test_integration_ssl.rb +++ b/test/test_integration_ssl.rb @@ -1,6 +1,7 @@ require_relative 'helper' require_relative "helpers/integration" + # These tests are used to verify that Puma works with SSL sockets. Only # integration tests isolate the server from the test environment, so there # should be a few SSL tests. @@ -15,18 +16,10 @@ class TestIntegrationSSL < TestIntegration require "net/http" require "openssl" - def teardown - @server.close unless @server.closed? - @server = nil - super - end - - def generate_config(opts = nil) + def setup @bind_port = UniquePort.call @control_tcp_port = UniquePort.call - - config = <