Skip to content

Commit

Permalink
Fix #195, don't log ssl.CertificateError
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix committed Oct 5, 2018
1 parent 8d5a9a3 commit ad0b9c4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 1 addition & 3 deletions uvloop/handles/basetransport.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ cdef class UVBaseTransport(UVSocketHandle):

self._force_close(exc)

if not isinstance(exc, (BrokenPipeError,
ConnectionResetError,
ConnectionAbortedError)):
if not isinstance(exc, FATAL_SSL_ERROR_IGNORE):

if throw or self._loop is None:
raise exc
Expand Down
4 changes: 1 addition & 3 deletions uvloop/handles/streamserver.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ cdef class UVStreamServer(UVSocketHandle):

self._close()

if not isinstance(exc, (BrokenPipeError,
ConnectionResetError,
ConnectionAbortedError)):
if not isinstance(exc, FATAL_SSL_ERROR_IGNORE):

if throw or self._loop is None:
raise exc
Expand Down
7 changes: 7 additions & 0 deletions uvloop/includes/stdlib.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ cdef int ssl_SSL_ERROR_WANT_READ = ssl.SSL_ERROR_WANT_READ
cdef int ssl_SSL_ERROR_WANT_WRITE = ssl.SSL_ERROR_WANT_WRITE
cdef int ssl_SSL_ERROR_SYSCALL = ssl.SSL_ERROR_SYSCALL

cdef FATAL_SSL_ERROR_IGNORE = (
BrokenPipeError,
ConnectionResetError,
ConnectionAbortedError,
ssl.CertificateError,
)

cdef uint64_t MAIN_THREAD_ID = <uint64_t><int64_t>threading.main_thread().ident

cdef int subprocess_PIPE = subprocess.PIPE
Expand Down
4 changes: 1 addition & 3 deletions uvloop/sslproto.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,7 @@ cdef class SSLProtocol:
if self._transport:
self._transport._force_close(exc)

if isinstance(exc, (BrokenPipeError,
ConnectionResetError,
ConnectionAbortedError)):
if isinstance(exc, FATAL_SSL_ERROR_IGNORE):
if self._loop.get_debug():
aio_logger.debug("%r: %s", self, message, exc_info=True)
elif not isinstance(exc, aio_CancelledError):
Expand Down

0 comments on commit ad0b9c4

Please sign in to comment.