GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — asyncio SSL transport ignores `ssl_shutdown_timeout` after the peer sends EOF · Issue #160520 · python/cpython Closed Closed Copy link Labels stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-SSLtopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:
import asyncio, socket, ssl from test.support import findfile CERT = findfile('keycert.pem', subdir='certdata') async def handler(reader, writer): await reader.readline() writer.write(bytes(16 << 20)) writer.close() try: await asyncio.wait_for(writer.wait_closed(), 5) except TimeoutError as e: print('server:', repr(e) if e.args else 'still open after 5 s') writer.transport.abort() def client(port, half_close): ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE s = ctx.wrap_socket(socket.create_connection(('127.0.0.1', port))) s.sendall(b'x\n') if half_close: s.shutdown(socket.SHUT_WR) return s # never read async def main(): sctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) sctx.load_cert_chain(CERT) server = await asyncio.start_server( handler, '127.0.0.1', 0, ssl=sctx, ssl_shutdown_timeout=1) port = server.sockets[0].getsockname()[1] for half_close in (False, True): print('peer half-closes:', half_close) s = await asyncio.to_thread(client, port, half_close) await asyncio.sleep(6) s.close() server.close() await server.wait_closed() asyncio.run(main()) Output: Expected: both connections are aborted with CPython versions tested on:CPython main branch Operating systems tested on:Linux Linked PRsActivity
MetadataMetadataAssigneesLabelsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-SSLtopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error Projects
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |