Skip to content

Commit 0dd7180

Browse files
authored
bpo-34630: Skip logging SSL certificate errors by asyncio code (GH-9169)
1 parent 5b10d51 commit 0dd7180

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Lib/asyncio/base_events.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
_FATAL_ERROR_IGNORE = (BrokenPipeError,
6363
ConnectionResetError, ConnectionAbortedError)
6464

65+
if ssl is not None:
66+
_FATAL_ERROR_IGNORE = _FATAL_ERROR_IGNORE + (ssl.SSLCertVerificationError,)
67+
6568
_HAS_IPv6 = hasattr(socket, 'AF_INET6')
6669

6770
# Maximum timeout passed to select to avoid OS limitations
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Don't log SSL certificate errors in asyncio code (connection error logging
2+
is skipped already).

0 commit comments

Comments
 (0)