pub fn connect_starttls<A: ToSocketAddrs, S: AsRef<str>>(
addr: A,
domain: S,
ssl_connector: &TlsConnector,
) -> Result<Client<TlsStream<TcpStream>>>
Expand description
Connect to a server and upgrade to a TLS-encrypted connection.
This is the STARTTLS equivalent to connect
. All
notes there also apply here.
ยงExamples
let tls = TlsConnector::builder().build().unwrap();
let client = imap::connect_starttls(("imap.example.org", 143), "imap.example.org", &tls).unwrap();