pub fn tls<C: Into<TlsPolicy>, S: Into<TlsPolicy>>(
        &mut self,
        client: C,
        server: S,
    ) -> &mut Self {
        let client_policy = client.into();
        let server_policy = server.into();

        use std::mem::discriminant;
        match (&client_policy, &server_policy) {
            // If the two policies do not have the same variant, they are probably incompatible
            _ if discriminant(&client_policy) != discriminant(&server_policy) => {
                warn!("Client TLS policy type is different than the Server TLS policy type!");
            }
            // If the client and server domains do not match, give a warning
            (TlsPolicy::Verified(client), TlsPolicy::Verified(server))
                if client.domain() != server.domain() =>
            {
                warn!(
                    client_domain = client.domain(),
                    server_domain = server.domain(),
                    "Client TLS config has a different domain than the Server TLS config!"
                );
            }
            _ => (),
        }
        self.client_tls_policy = Some(client_policy);
        self.server_tls_policy = Some(server_policy);
        self
    }
/// Sets the TLS Policy that the client and server will use to communicate.
///
/// By default, these are set to `TlsPolicy::Disabled`.
///
/// # Example
///
/// ```
/// # use fluvio_cluster::{LocalConfig, LocalConfigBuilder, ClusterError};
/// # fn example(builder: &mut LocalConfigBuilder) -> Result<(), ClusterError> {
/// use std::path::PathBuf;
/// use fluvio::config::TlsPaths;
/// use fluvio_cluster::LocalInstaller;
/// use semver::Version;
///
/// let cert_path = PathBuf::from("/tmp/certs");
/// let client = TlsPaths {
///     domain: "fluvio.io".to_string(),
///     ca_cert: cert_path.join("ca.crt"),
///     cert: cert_path.join("client.crt"),
///     key: cert_path.join("client.key"),
/// };
/// let server = TlsPaths {
///     domain: "fluvio.io".to_string(),
///     ca_cert: cert_path.join("ca.crt"),
///     cert: cert_path.join("server.crt"),
///     key: cert_path.join("server.key"),
/// };
///
/// let config = LocalConfig::builder(Version::parse("0.7.0-alpha.1").unwrap())
///     .tls(client, server)
///     .build()?;
/// # Ok(())
/// # }
/// ```
Sets the TLS Policy that the client and server will use to communicate.
By default, these are set to `TlsPolicy::Disabled`.
Sets the TLS Policy that the client and server will use to communicate . By default these are set to ` TlsPolicy :: Disabled ` .
pub fn tls<C: Into<TlsPolicy>, S: Into<TlsPolicy>>(
        &mut self,
        client: C,
        server: S,
    ) -> &mut Self {
        let client_policy = client.into();
        let server_policy = server.into();
        use std::mem::discriminant;
        match (&client_policy, &server_policy) {
            // If the two policies do not have the same variant, they are probably incompatible
            _ if discriminant(&client_policy) != discriminant(&server_policy) => {
                warn!("Client TLS policy type is different than the Server TLS policy type!");
            }
            // If the client and server domains do not match, give a warning
            (TlsPolicy::Verified(client), TlsPolicy::Verified(server))
                if client.domain() != server.domain() =>
            {
                warn!(
                    client_domain = client.domain(),
                    server_domain = server.domain(),
                    "Client TLS config has a different domain than the Server TLS config!"
                );
            }
            _ => (),
        }
        self.client_tls_policy = Some(client_policy);
        self.server_tls_policy = Some(server_policy);
        self
    }
pub fn tls < C : Into < TlsPolicy > , S : Into < TlsPolicy > > ( & mut self , client : C , server : S , ) -> & mut Self { let client_policy = client . into ( ) ; let server_policy = server . into ( ) ; use std :: mem :: discriminant ; match ( & client_policy , & server_policy ) { // If the two policies do not have the same variant, they are probably incompatible _ if discriminant ( & client_policy ) != discriminant ( & server_policy ) => { warn ! ( " " ) ; } // If the client and server domains do not match, give a warning ( TlsPolicy :: Verified ( client ) , TlsPolicy :: Verified ( server ) ) if client . domain ( ) != server . domain ( ) => { warn ! ( client_domain client domain ( ) server_domain server domain ( ) " " ) ; } _ => ( ) , } self . client_tls_policy = Some ( client_policy ) ; self . server_tls_policy = Some ( server_policy ) ; self }
Sets the TLS Policy that the client and server will use to communicate.
Sets the TLS Policy that the client and server will use to communicate .
&mut self
client
C
server
S
&mut self
client
C
server
S
example
None
use fluvio_cluster::{localconfig, localconfigbuilder, clustererror};
None
fn example(builder: &mut localconfigbuilder) -> result<(), clustererror> {


let cert_path = PathBuf::from("/tmp/certs");
let client = TlsPaths {
domain: "fluvio.io".to_string(),
ca_cert: cert_path.join("ca.crt"),
cert: cert_path.join("client.crt"),
key: cert_path.join("client.key"),
};
let server = TlsPaths {
domain: "fluvio.io".to_string(),
ca_cert: cert_path.join("ca.crt"),
cert: cert_path.join("server.crt"),
key: cert_path.join("server.key"),
}.

let config = LocalConfig::builder(Version::parse("0.7.0-alpha.1").unwrap())
.tls(client, server)
.build()?.
let cert_path = PathBuf :: from ( " / tmp / certs " ) ; let client = TlsPaths { domain : " fluvio . io " . to_string () ca_cert : cert_path . join ( " ca . crt " ) cert : cert_path . join ( " client . crt " ) key : cert_path . join ( " client . key " ) } ; let server = TlsPaths { domain : " fluvio . io " . to_string () ca_cert : cert_path . join ( " ca . crt " ) cert : cert_path . join ( " server . crt " ) key : cert_path . join ( " server . key " ) } . let config = LocalConfig :: builder ( Version :: parse ( " 0 . 7 . 0 - alpha . 1 " ) . unwrap () ) . tls ( client server ) . build () ? .
ok(())
None
}
None