Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: ssl negotiation unhandled exception
  • Loading branch information
yemreck committed Mar 12, 2026
commit 387d57b3e51aad0881c899b902324b9edc55ece1
5 changes: 4 additions & 1 deletion asyncpg/connect_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,10 @@ def data_received(self, data: bytes) -> None:
def connection_lost(self, exc: typing.Optional[Exception]) -> None:
if not self.on_data.done():
if exc is None:
exc = ConnectionError('unexpected connection_lost() call')
exc = ConnectionResetError(
'PostgreSQL server at "{host}:{port}" '
'closed the connection during SSL negotiation'.format(
host=self.host, port=self.port))
self.on_data.set_exception(exc)


Expand Down