async def METHOD_NAME(
    self,
    hostname: bytes,
    ssl_context: SSLContext,
    timeout: TimeoutDict,
) -> "SocketStream":
    connect_timeout = timeout.get("connect")
    try:
        with anyio.fail_after(connect_timeout):
            ssl_stream = await TLSStream.wrap(
                self.stream,
                ssl_context=ssl_context,
                hostname=hostname.decode("ascii"),
                standard_compatible=False,
            )
    except TimeoutError:
        raise ConnectTimeout from None
    except BrokenResourceError as exc:
        raise ConnectError from exc
    return SocketStream(ssl_stream)