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

wsgi: ignore ssl.SSLZeroReturnError at request finish() #787

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions eventlet/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,9 @@
def finish(self):
try:
BaseHTTPServer.BaseHTTPRequestHandler.finish(self)
except ssl.SSLZeroReturnError:
# TLS version of connection reset by peer
pass

Check warning on line 763 in eventlet/wsgi.py

View check run for this annotation

Codecov / codecov/patch

eventlet/wsgi.py#L763

Added line #L763 was not covered by tests
except socket.error as e:
# Broken pipe, connection reset by peer
if support.get_errno(e) not in BROKEN_SOCK:
Expand Down
8 changes: 0 additions & 8 deletions tests/wsgi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,6 @@ def wsgi_app(environ, start_response):
start_response('200 OK', {})
return [environ['wsgi.input'].read()]

certificate_file = os.path.join(os.path.dirname(__file__), 'test_server.crt')
private_key_file = os.path.join(os.path.dirname(__file__), 'test_server.key')

server_sock = eventlet.wrap_ssl(eventlet.listen(('localhost', 0)),
certfile=certificate_file,
keyfile=private_key_file,
Expand All @@ -469,8 +466,6 @@ def wsgi_app(environ, start_response):
start_response("200 OK", [])
return [b""]

certificate_file = os.path.join(os.path.dirname(__file__), 'test_server.crt')
private_key_file = os.path.join(os.path.dirname(__file__), 'test_server.key')
server_sock = eventlet.wrap_ssl(eventlet.listen(('localhost', 0)),
certfile=certificate_file,
keyfile=private_key_file,
Expand Down Expand Up @@ -582,9 +577,6 @@ def wsgi_app(environ, start_response):
start_response('200 OK', [])
return [environ['wsgi.input'].read()]

certificate_file = os.path.join(os.path.dirname(__file__), 'test_server.crt')
private_key_file = os.path.join(os.path.dirname(__file__), 'test_server.key')

sock = eventlet.wrap_ssl(
eventlet.listen(('localhost', 0)),
certfile=certificate_file, keyfile=private_key_file,
Expand Down