Skip to content

Commit

Permalink
bpo-32947: test_ssl fixes for TLS 1.3 and OpenSSL 1.1.1 (GH-11612)
Browse files Browse the repository at this point in the history
Backport partially commit 529525f:
complete the previous partial backport (commit
2a4ee8a.

Co-Authored-By: Christian Heimes <christian@python.org>
  • Loading branch information
2 people authored and ned-deily committed May 29, 2019
1 parent 2b9d7ab commit 3dbc43f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,16 @@ def run(self):
sys.stdout.write(" server: read %r (%s), sending back %r (%s)...\n"
% (msg, ctype, msg.lower(), ctype))
self.write(msg.lower())
except ConnectionResetError:
# XXX: OpenSSL 1.1.1 sometimes raises ConnectionResetError
# when connection is not shut down gracefully.
if self.server.chatty and support.verbose:
sys.stdout.write(
" Connection reset by peer: {}\n".format(
self.addr)
)
self.close()
self.running = False
except OSError:
if self.server.chatty:
handle_error("Test server failure:\n")
Expand Down Expand Up @@ -2108,6 +2118,11 @@ def run(self):
pass
except KeyboardInterrupt:
self.stop()
except BaseException as e:
if support.verbose and self.chatty:
sys.stdout.write(
' connection handling failed: ' + repr(e) + '\n')

self.sock.close()

def stop(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test_ssl fixes for TLS 1.3 and OpenSSL 1.1.1.

0 comments on commit 3dbc43f

Please sign in to comment.