Skip to content

Commit dc5a3b9

Browse files
committed
Don't expect the server to shutdown TLS before closing the underlying connection
1 parent 136da0f commit dc5a3b9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

redis/anyio/connection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,11 @@ def repr_pieces(self):
718718
return pieces
719719

720720
def _connection_arguments(self) -> Mapping:
721-
return {"remote_host": self.host, "remote_port": self.port}
721+
return {
722+
"remote_host": self.host,
723+
"remote_port": self.port,
724+
"tls_standard_compatible": False,
725+
}
722726

723727
async def _connect(self):
724728
"""Create a TCP socket connection"""

tests/test_anyio/test_connect.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ async def _handler(stream: ByteStream):
166166
context.maximum_version = maximum_ssl_version
167167
context.load_cert_chain(certfile=certfile, keyfile=keyfile)
168168
tcp_listener = await anyio.create_tcp_listener(local_host=host, local_port=port)
169-
listener = TLSListener(tcp_listener, ssl_context=context)
169+
listener = TLSListener(
170+
tcp_listener, ssl_context=context, standard_compatible=False
171+
)
170172
else:
171173
host, port = server_address
172174
listener = await anyio.create_tcp_listener(local_host=host, local_port=port)

0 commit comments

Comments
 (0)