From 70e381d853f09520b198d17523676409010a9a49 Mon Sep 17 00:00:00 2001 From: Nate Berkopec Date: Mon, 7 Oct 2019 16:03:05 +0200 Subject: [PATCH] Don't allow EINVAL to raise during SSL addr check Closes #1564 Co-authored-by: hahmed --- lib/puma/reactor.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/puma/reactor.rb b/lib/puma/reactor.rb index 50b655038e..384f923845 100644 --- a/lib/puma/reactor.rb +++ b/lib/puma/reactor.rb @@ -237,7 +237,8 @@ def run_internal ssl_socket = c.io begin addr = ssl_socket.peeraddr.last - rescue IOError + # EINVAL can happen when browser closes socket w/security exception + rescue IOError, Errno::EINVAL addr = "" end