ws: don't attempt to parse TLS files when running without TLS

This commit is contained in:
Joakim Frostegård 2022-07-19 17:29:13 +02:00
parent 72c66e6e1a
commit 7b06bf8736
3 changed files with 8 additions and 7 deletions

View file

@ -47,13 +47,14 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
let (sentinel_watcher, sentinel) = PanicSentinelWatcher::create_with_sentinel();
let priv_dropper = PrivilegeDropper::new(config.privileges.clone(), config.socket_workers);
let opt_tls_config = config
.network
.enable_tls
.then_some(Arc::new(create_rustls_config(
let opt_tls_config = if config.network.enable_tls {
Some(Arc::new(create_rustls_config(
&config.network.tls_certificate_path,
&config.network.tls_private_key_path,
)?));
)?))
} else {
None
};
let mut executors = Vec::new();