diff --git a/README.md b/README.md index 82ab2420..da7b06c6 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ with the `tls` feature flag enabled. When using TLS, some additional information is required. You will need to make [`TlsAcceptor`] and `client::tls::Context` structs; `client::tls::Context` requires a [`TlsConnector`]. The [`TlsAcceptor`] and [`TlsConnector`] types are defined in the [native-tls]. tarpc re-exports -external TLS-related types in its `tls` module (`tarpc::tls`). +external TLS-related types in its `native_tls` module (`tarpc::native_tls`). [TLS]: https://en.wikipedia.org/wiki/Transport_Layer_Security [`TcpStream`]: https://docs.rs/tokio-core/0.1/tokio_core/net/struct.TcpStream.html @@ -172,7 +172,7 @@ use tarpc::{client, server}; use tarpc::client::future::Connect; use tarpc::util::{FirstSocketAddr, Never}; use tokio_core::reactor; -use tarpc::tls::{Pkcs12, TlsAcceptor}; +use tarpc::native_tls::{Pkcs12, TlsAcceptor}; service! { rpc hello(name: String) -> String; diff --git a/src/client.rs b/src/client.rs index e86ece67..a1a2b192 100644 --- a/src/client.rs +++ b/src/client.rs @@ -27,7 +27,7 @@ type BindClient = >> as /// TLS-specific functionality #[cfg(feature = "tls")] pub mod tls { - use native_tls::TlsConnector; + use native_tls::{Error, TlsConnector}; /// TLS context for client pub struct Context { @@ -43,7 +43,7 @@ pub mod tls { /// The provided domain will be used for both /// [SNI](https://en.wikipedia.org/wiki/Server_Name_Indication) and certificate hostname /// validation. - pub fn new>(domain: S) -> Result { + pub fn new>(domain: S) -> Result { Ok(Context { domain: domain.into(), tls_connector: TlsConnector::builder()?.build()?, diff --git a/src/lib.rs b/src/lib.rs index b1bf7279..da44cecf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,7 +72,7 @@ //! use tarpc::{client, server}; //! use tarpc::client::sync::Connect; //! use tarpc::util::Never; -//! use tarpc::tls::{TlsAcceptor, Pkcs12}; +//! use tarpc::native_tls::{TlsAcceptor, Pkcs12}; //! //! service! { //! rpc hello(name: String) -> String; @@ -192,12 +192,11 @@ enum Reactor { cfg_if! { if #[cfg(feature = "tls")] { extern crate tokio_tls; - extern crate native_tls; + extern crate native_tls as native_tls_inner; /// Re-exported TLS-related types - pub mod tls { - pub use native_tls::Error as NativeTlsError; - pub use native_tls::{Pkcs12, TlsAcceptor, TlsConnector}; + pub mod native_tls { + pub use native_tls_inner::{Error, Pkcs12, TlsAcceptor, TlsConnector}; } } else {} } diff --git a/src/macros.rs b/src/macros.rs index 2e444789..645eab3d 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -720,7 +720,7 @@ mod functional_test { const DOMAIN: &'static str = "foobar.com"; use client::tls::Context; - use ::native_tls::{Pkcs12, TlsAcceptor, TlsConnector}; + use native_tls::{Pkcs12, TlsAcceptor, TlsConnector}; fn tls_context() -> (server::Options, client::Options) { let buf = include_bytes!("../test/identity.p12"); @@ -741,7 +741,7 @@ mod functional_test { extern crate security_framework; use self::security_framework::certificate::SecCertificate; - use native_tls::backend::security_framework::TlsConnectorBuilderExt; + use native_tls_inner::backend::security_framework::TlsConnectorBuilderExt; fn get_tls_client_options() -> client::Options { let buf = include_bytes!("../test/root-ca.der"); @@ -755,7 +755,7 @@ mod functional_test { }) } } else if #[cfg(all(not(target_os = "macos"), not(windows)))] { - use native_tls::backend::openssl::TlsConnectorBuilderExt; + use native_tls_inner::backend::openssl::TlsConnectorBuilderExt; fn get_tls_client_options() -> client::Options { let mut connector = unwrap!(TlsConnector::builder());