Closed umanwizard closed 5 years ago
I can provide a take_inner
for Connect
/Accept
, which should suffice.
impl<IO> Accept<IO> {
fn take_inner(&mut self) -> Option<IO>;
}
That would be great, thanks!
I just published 0.10.0-alpha.4
, and if you need, I can give 0.9
a backport.
Thanks for the quick turnaround. take_inner
is seeming to work for my use case in 0.10.0-alpha.4
I have a
tokio::net::TcpStream
which I am passing totokio_rustls::TlsAcceptor::accept
. If the TLS handshake fails, I would like to continue sending and receiving other (cleartext) data on the underlyingTcpStream
. However, sinceaccept
takes the socket by value (i.e., moving out of it), I can see no way to re-use it again in the future.The reason this is required is because I am building an SMTP server, and the relevant RFCs allow a server to continue attempting to send mail in cleartext if the STARTTLS negotiation fails. This is particularly relevant when using rustls, as there are mail servers out there using pre-TLSv1.2 versions (which rustls doesn't support), and I still want to be able to get mail from them.