fix(transport): Remove with_rustls for tls config (#188)
This commit is contained in:
@@ -167,6 +167,7 @@ impl Endpoint {
|
||||
|
||||
/// Configures TLS for the endpoint.
|
||||
#[cfg(feature = "tls")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
|
||||
pub fn tls_config(self, tls_config: ClientTlsConfig) -> Self {
|
||||
Endpoint {
|
||||
tls: Some(tls_config.tls_connector(self.uri.clone()).unwrap()),
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
mod endpoint;
|
||||
#[cfg(feature = "tls")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
|
||||
mod tls;
|
||||
|
||||
pub use endpoint::Endpoint;
|
||||
|
||||
@@ -7,6 +7,7 @@ use std::fmt;
|
||||
|
||||
/// Configures TLS settings for endpoints.
|
||||
#[cfg(feature = "tls")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
|
||||
#[derive(Clone)]
|
||||
pub struct ClientTlsConfig {
|
||||
domain: Option<String>,
|
||||
@@ -29,7 +30,7 @@ impl fmt::Debug for ClientTlsConfig {
|
||||
#[cfg(feature = "tls")]
|
||||
impl ClientTlsConfig {
|
||||
/// Creates a new `ClientTlsConfig` using Rustls.
|
||||
pub fn with_rustls() -> Self {
|
||||
pub fn new() -> Self {
|
||||
ClientTlsConfig {
|
||||
domain: None,
|
||||
cert: None,
|
||||
|
||||
@@ -107,8 +107,10 @@ pub use self::tls::{Certificate, Identity};
|
||||
pub use hyper::Body;
|
||||
|
||||
#[cfg(feature = "tls")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
|
||||
pub use self::channel::ClientTlsConfig;
|
||||
#[cfg(feature = "tls")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
|
||||
pub use self::server::ServerTlsConfig;
|
||||
|
||||
pub(crate) use self::error::ErrorKind;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
mod conn;
|
||||
mod incoming;
|
||||
#[cfg(feature = "tls")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
|
||||
mod tls;
|
||||
|
||||
pub use conn::Connected;
|
||||
@@ -98,6 +99,7 @@ impl Server {
|
||||
impl Server {
|
||||
/// Configure TLS for this server.
|
||||
#[cfg(feature = "tls")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
|
||||
pub fn tls_config(self, tls_config: ServerTlsConfig) -> Self {
|
||||
Server {
|
||||
tls: Some(tls_config.tls_acceptor().unwrap()),
|
||||
|
||||
@@ -6,6 +6,7 @@ use std::fmt;
|
||||
|
||||
/// Configures TLS settings for servers.
|
||||
#[cfg(feature = "tls")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
|
||||
#[derive(Clone)]
|
||||
pub struct ServerTlsConfig {
|
||||
identity: Option<Identity>,
|
||||
@@ -23,7 +24,7 @@ impl fmt::Debug for ServerTlsConfig {
|
||||
#[cfg(feature = "tls")]
|
||||
impl ServerTlsConfig {
|
||||
/// Creates a new `ServerTlsConfig`.
|
||||
pub fn with_rustls() -> Self {
|
||||
pub fn new() -> Self {
|
||||
ServerTlsConfig {
|
||||
identity: None,
|
||||
client_ca_root: None,
|
||||
|
||||
Reference in New Issue
Block a user