Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit 970d993

Browse files
authored
Fix for #404
Don't pass ssl certivicate error to loop.call_exception_handler() Handle ssl.CertificateError only because ssl.SSLError may be raised not only on connection establishment.
1 parent eb4c3ff commit 970d993

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

asyncio/base_events.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
from .coroutines import coroutine
3838
from .log import logger
3939

40+
try:
41+
import ssl
42+
except ImportError:
43+
ssl = None
44+
4045

4146
__all__ = ['BaseEventLoop']
4247

@@ -53,6 +58,8 @@
5358
# methods (_fatal_error())
5459
_FATAL_ERROR_IGNORE = (BrokenPipeError,
5560
ConnectionResetError, ConnectionAbortedError)
61+
if ssl is not None:
62+
_FATAL_ERROR_IGNORE = _FATAL_ERROR_IGNORE + (ssl.CertificateError,)
5663

5764

5865
def _format_handle(handle):

0 commit comments

Comments
 (0)