@@ -196,7 +196,7 @@ cdef class _SSLPipe:
196
196
# Drain possible plaintext data after close_notify.
197
197
appdata.append(self ._incoming.read())
198
198
except (ssl_SSLError, ssl_CertificateError) as exc:
199
- errno = < int > exc. errno
199
+ errno = < int > getattr ( exc, ' errno' , 0 ) # SSL_ERROR_NONE = 0
200
200
if errno not in (ssl_SSL_ERROR_WANT_READ, ssl_SSL_ERROR_WANT_WRITE,
201
201
ssl_SSL_ERROR_SYSCALL):
202
202
if self ._state is _DO_HANDSHAKE and self ._handshake_cb:
@@ -244,7 +244,7 @@ cdef class _SSLPipe:
244
244
if offset < len (view):
245
245
offset += self ._sslobj.write(view[offset:])
246
246
except ssl_SSLError as exc:
247
- errno = < int > exc. errno
247
+ errno = < int > getattr ( exc, ' errno' , 0 ) # SSL_ERROR_NONE = 0
248
248
# It is not allowed to call write() after unwrap() until the
249
249
# close_notify is acknowledged. We return the condition to the
250
250
# caller as a short write.
@@ -495,8 +495,9 @@ class SSLProtocol(object):
495
495
ssldata, appdata = (< _SSLPipe> self ._sslpipe).feed_ssldata(data)
496
496
except ssl_SSLError as e:
497
497
if self ._loop.get_debug():
498
- aio_logger.warning(' %r : SSL error %s (reason %s )' ,
499
- self , e.errno, e.reason)
498
+ aio_logger.warning(' %r : SSL error errno:%s (reason %s )' ,
499
+ self , getattr (e, ' errno' , ' missing' ),
500
+ e.reason)
500
501
self ._abort()
501
502
return
502
503
0 commit comments