Skip to content

Commit 5958f59

Browse files
committed
PYTHON-5272 Reference closed CPython issue for async TLS session workaround
1 parent 7c2264e commit 5958f59

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pymongo/pool_shared.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ def _get_ssl_session(ssl_sock: Any) -> Optional[Any]:
7373
return getattr(ssl_sock, "session", None)
7474

7575

76-
# asyncio's SSLProtocol does not expose a session= parameter in create_connection.
76+
# asyncio's create_connection does not support TLS session resumption natively.
77+
# https://github.com/python/cpython/issues/79152 tracks this; a patch was submitted
78+
# in 2018 but never merged, and the issue is now closed.
7779
# On Python 3.11+, wrap_bio() is called in SSLProtocol.__init__ and the handshake
7880
# starts later in connection_made(), so we can set sslobj.session between the two.
7981
# On older Python, _SSLPipe.do_handshake calls wrap_bio and starts the handshake

0 commit comments

Comments
 (0)