Skip to content

Commit

Permalink
Undo accidental change to smtp.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoluan committed Jan 13, 2023
1 parent 23e4234 commit 856fb1a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aiosmtpd/smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __repr__(self) -> str:
class Session:
def __init__(self, loop: asyncio.AbstractEventLoop):
self.peer = None
self.ssl_context = None
self.ssl = None
self.host_name = None
self.extended_smtp = False
self.loop = loop
Expand Down Expand Up @@ -362,7 +362,7 @@ def __init__(
self._timeout_duration = timeout
self._timeout_handle = None
self._tls_handshake_okay = True
self._tls_protocol: Optional[asyncio.sslproto.SSLProtocol] = None
self._tls_protocol = None
self._original_transport = None
self.session: Optional[Session] = None
self.envelope: Optional[Envelope] = None
Expand Down Expand Up @@ -506,7 +506,7 @@ def connection_made(self, transport: asyncio.transports.BaseTransport) -> None:
self.transport = transport
# Do SSL certificate checking as rfc3207 part 4.1 says. Why is
# _extra a protected attribute?
self.session.ssl_context = transport.get_extra_info("sslcontext")
self.session.ssl = self._tls_protocol._extra
hook = self._handle_hooks.get("STARTTLS")
if hook is None:
self._tls_handshake_okay = True
Expand Down Expand Up @@ -538,7 +538,7 @@ def connection_lost(self, error: Optional[Exception]) -> None:
def eof_received(self) -> bool:
log.info('%r EOF received', self.session.peer)
self._handler_coroutine.cancel()
if self.session.ssl_context is not None:
if self.session.ssl is not None:
# If STARTTLS was issued, return False, because True has no effect
# on an SSL transport and raises a warning. Our superclass has no
# way of knowing we switched to SSL so it might return True.
Expand Down

0 comments on commit 856fb1a

Please sign in to comment.