Skip to content

Commit c548380

Browse files
ajyoungwebknjaz
authored andcommitted
Uncaught socket exception during timeout handling
1 parent 1ff20b1 commit c548380

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: cheroot/ssl/pyopenssl.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,14 @@ def _safe_call(self, is_reader, call, *args, **kwargs): # noqa: C901
9999
except SSL.WantWriteError:
100100
time.sleep(self.ssl_retry)
101101
except SSL.SysCallError as e:
102-
if is_reader and e.args == (-1, 'Unexpected EOF'):
103-
return b''
102+
if e.args == (-1, 'Unexpected EOF'):
103+
if is_reader:
104+
return b''
105+
else:
106+
# See #210. Prevents DOS attack caused by
107+
# silent connections lasting beyond connection
108+
# timeout length.
109+
raise errors.FatalSSLAlert(*e.args)
104110

105111
errnum = e.args[0]
106112
if is_reader and errnum in errors.socket_errors_to_ignore:

0 commit comments

Comments
 (0)