From 97671062ee686cbff0a66803595c99f7df721e72 Mon Sep 17 00:00:00 2001 From: Bryce Fisher-Fleig Date: Fri, 20 Sep 2019 23:37:02 -0700 Subject: [PATCH] (doc) Explain how and why to opt out of native_tls Also point out the examples/rustlts.rs file for pure Rust TLS goodness --- src/lib.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7c85baa..48fc3d9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,13 +50,29 @@ //! let body = std::str::from_utf8(body) //! .expect("message was not valid utf-8") //! .to_string(); -//! +//! //! // be nice to the server and log out //! imap_session.logout()?; -//! +//! //! Ok(Some(body)) //! } //! ``` +//! +//! ## Opting out of `native_tls` +//! +//! For situations where using openssl becomes problematic, you can disable the +//! default feature which provides integration with the `native_tls` crate. One major +//! reason you might want to do this is cross-compiling. To opt out of native_tls, add +//! this to your Cargo.toml file: +//! +//! ```toml +//! [dependencies.imap] +//! version = "" +//! default-features = false +//! ``` +//! +//! Even without `native_tls`, you can still use TLS by leveraging the pure Rust `rustls` +//! crate. See the example/rustls.rs file for a working example. #![deny(missing_docs)] #![warn(rust_2018_idioms)]