You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I pass the desired tcp_stream into establish(), and return a Box that has the dyn ReadWrite trait:
impl TlsConnector for MbedTlsConnector {
fn connect(
&self,
dns_name: &str,
tcp_stream: TcpStream,
) -> Result<Box<dyn ReadWrite>, Error> {
let ctx = self.context.lock().unwrap();
match ctx.establish(tcp_stream, None) {
I need to implement a socket routine for this, returning the same tcp_stream as before, but the obvious method of calling context.io() isn't going to work, because it return dyn Any, and I think that I need a dyn ReadWrite.
impl ReadWrite for MbedTlsConnector {
fn socket(&self) -> Option<&TcpStream> {
let ctx = self.context.lock().unwrap();
Some(&(ctx.io() as TcpStream))
}
}
Looking for advice here. Maybe the wrapper establish()/io() should change?
Or what?
The text was updated successfully, but these errors were encountered:
My question remains... I don't know how to get the socket back out, and I think that maybe it is impossible.
ureq would like it so that it can do connection caching. For now, I am just turning that off.
See: algesten/ureq#469
I am trying to connect MbedTls to the ureq's newest TLSConnector.
My WIP (does not compile) is at:
https://github.com/AnimaGUS-minerva/ureq/tree/mbedtls-2/examples/mbedtls-req
I pass the desired tcp_stream into establish(), and return a Box that has the dyn ReadWrite trait:
I need to implement a socket routine for this, returning the same tcp_stream as before, but the obvious method of calling context.io() isn't going to work, because it return dyn Any, and I think that I need a dyn ReadWrite.
Looking for advice here. Maybe the wrapper establish()/io() should change?
Or what?
The text was updated successfully, but these errors were encountered: