]> granicus.if.org Git - python/commitdiff
bpo-34630: Skip logging SSL certificate errors by asyncio code (GH-9169)
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Wed, 12 Sep 2018 21:03:54 +0000 (14:03 -0700)
committerGitHub <noreply@github.com>
Wed, 12 Sep 2018 21:03:54 +0000 (14:03 -0700)
Lib/asyncio/base_events.py
Misc/NEWS.d/next/Library/2018-09-11-10-00-53.bpo-34630.YbqUS6.rst [new file with mode: 0644]

index 046743864fddb472b87d49b5a770640a4fc82a42..492e377d09e08c79c1b41bf641aa037f9a30356e 100644 (file)
@@ -62,6 +62,9 @@ _MIN_CANCELLED_TIMER_HANDLES_FRACTION = 0.5
 _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 (file)
index 0000000..452bcb6
--- /dev/null
@@ -0,0 +1,2 @@
+Don't log SSL certificate errors in asyncio code (connection error logging
+is skipped already).