use rustls::ServerConfig;
#[derive(Clone)]
pub struct TlsConfig {
pub enabled: bool,
pub cert_path: String,
pub key_path: String,
pub ca_path: String,
pub client_cert_path: String,
pub client_key_path: String,
pub client_ca_path: String,
pub mode: String,
pub socket_addr: Option<std::net::SocketAddr>,
pub server_endpoint: String,
pub server_config: ServerConfig,
}
impl TlsConfig {
pub fn show(&self) {
println!(
"enabled={} \
server_endpoint={} \
cert={} \
key={} \
ca={} \
client_cert={} \
client_key={} \
client_ca={} \
mode={}",
self.enabled,
self.server_endpoint,
self.cert_path,
self.key_path,
self.ca_path,
self.client_cert_path,
self.client_key_path,
self.client_ca_path,
self.mode
);
}
}