pub(crate) async fn connect_tcp(
context: &Context,
host: &str,
port: u16,
load_cache: bool,
) -> Result<Pin<Box<TimeoutStream<TcpStream>>>>
Expand description
If load_cache
is true, may use cached DNS results.
Because the cache may be poisoned with incorrect results by networks hijacking DNS requests,
this option should only be used when connection is authenticated,
for example using TLS.
If TLS is not used or invalid TLS certificates are allowed,
this option should be disabled.