diff --git a/lib/puma/accept_nonblock.rb b/lib/puma/accept_nonblock.rb index e697032a2e..08ad997f8b 100644 --- a/lib/puma/accept_nonblock.rb +++ b/lib/puma/accept_nonblock.rb @@ -15,7 +15,11 @@ def accept_nonblock ssl.accept if @start_immediately ssl rescue SSLError => ex - sock.close + if ssl + ssl.close + else + sock.close + end raise ex end end diff --git a/test/test_integration.rb b/test/test_integration.rb index d9d9c49470..33d0a5cfec 100644 --- a/test/test_integration.rb +++ b/test/test_integration.rb @@ -517,5 +517,5 @@ def run_launcher(conf) @wait.sysread 1 [thr, launcher, @events] - end + end end