[Python-checkins] bpo-34630: Skip logging SSL certificate errors by asyncio code (GH-9169)

Andrew Svetlov webhook-mailer at python.org
Wed Sep 12 17:03:57 EDT 2018


https://github.com/python/cpython/commit/0dd71807a98c4a86ece2aea869ea99f09204b16b
commit: 0dd71807a98c4a86ece2aea869ea99f09204b16b
branch: master
author: Andrew Svetlov <andrew.svetlov at gmail.com>
committer: GitHub <noreply at github.com>
date: 2018-09-12T14:03:54-07:00
summary:

bpo-34630: Skip logging SSL certificate errors by asyncio code (GH-9169)

files:
A Misc/NEWS.d/next/Library/2018-09-11-10-00-53.bpo-34630.YbqUS6.rst
M Lib/asyncio/base_events.py

diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 046743864fdd..492e377d09e0 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -62,6 +62,9 @@
 _FATAL_ERROR_IGNORE = (BrokenPipeError,
                        ConnectionResetError, ConnectionAbortedError)
 
+if ssl is not None:
+    _FATAL_ERROR_IGNORE = _FATAL_ERROR_IGNORE + (ssl.SSLCertVerificationError,)
+
 _HAS_IPv6 = hasattr(socket, 'AF_INET6')
 
 # Maximum timeout passed to select to avoid OS limitations
diff --git a/Misc/NEWS.d/next/Library/2018-09-11-10-00-53.bpo-34630.YbqUS6.rst b/Misc/NEWS.d/next/Library/2018-09-11-10-00-53.bpo-34630.YbqUS6.rst
new file mode 100644
index 000000000000..452bcb6142a0
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-09-11-10-00-53.bpo-34630.YbqUS6.rst
@@ -0,0 +1,2 @@
+Don't log SSL certificate errors in asyncio code (connection error logging
+is skipped already).



More information about the Python-checkins mailing list