diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index 795530e6f6..c21b58218c 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -15,6 +15,7 @@ from . import events from . import exceptions from . import format_helpers from . import protocols +from . import sslproto from .log import logger from .tasks import sleep @@ -269,7 +270,7 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): reader = self._stream_reader if reader is not None: reader.set_transport(transport) - self._over_ssl = transport.get_extra_info('sslcontext') is not None + self._over_ssl = isinstance(transport, sslproto._SSLProtocolTransport) if self._client_connected_cb is not None: self._stream_writer = StreamWriter(transport, self, reader,