mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Warn that SSLSocket cannot send close_notify TLS alerts (#621)
* Warn that SSLSocket cannot send close_notify TLS alerts. * Improve formulation. Co-authored-by: Don Naro <dnaro@redhat.com> --------- Co-authored-by: Don Naro <dnaro@redhat.com>
This commit is contained in:
@@ -36,6 +36,10 @@ def _empty_writer(msg):
|
||||
|
||||
|
||||
def shutdown_writing(sock, log=_empty_writer):
|
||||
# FIXME: This does **not work with SSLSocket**! Apparently SSLSocket does not allow to send
|
||||
# a close_notify TLS alert without completely shutting down the connection.
|
||||
# Calling sock.shutdown(pysocket.SHUT_WR) simply turns of TLS encryption and from that
|
||||
# point on the raw encrypted data is returned when sock.recv() is called. :-(
|
||||
if hasattr(sock, 'shutdown_write'):
|
||||
sock.shutdown_write()
|
||||
elif hasattr(sock, 'shutdown'):
|
||||
|
||||
Reference in New Issue
Block a user