[Tokio] Upgrade TCP connection to TLS after handshake with tokio_proto



I want to create a TCP server using Tokio that can optionally upgrade the connection to TLS after the handshake.

I am currently following this guide on how to use handshakes: https://tokio.rs/docs/going-deeper/handshake/

However, I don’t know where to even start to translate the LineProto example to TCP that can upgrade to TLS.

I can use Tokio Core and tokio_rustls directly to accomplish this task, but I’d like to use tokio_proto to have a more structured server.