mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
ws: don't attempt to parse TLS files when running without TLS
This commit is contained in:
parent
72c66e6e1a
commit
7b06bf8736
3 changed files with 8 additions and 7 deletions
|
|
@ -10,7 +10,7 @@ use serde::Deserialize;
|
||||||
use aquatic_common::cli::LogLevel;
|
use aquatic_common::cli::LogLevel;
|
||||||
|
|
||||||
/// aquatic_http configuration
|
/// aquatic_http configuration
|
||||||
///
|
///
|
||||||
/// Does not support running behind a reverse proxy.
|
/// Does not support running behind a reverse proxy.
|
||||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
||||||
#[serde(default, deny_unknown_fields)]
|
#[serde(default, deny_unknown_fields)]
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ use aquatic_common::cli::LogLevel;
|
||||||
use aquatic_toml_config::TomlConfig;
|
use aquatic_toml_config::TomlConfig;
|
||||||
|
|
||||||
/// aquatic_ws configuration
|
/// aquatic_ws configuration
|
||||||
///
|
///
|
||||||
/// Running behind a reverse proxy is supported, but IPv4 peer requests have
|
/// Running behind a reverse proxy is supported, but IPv4 peer requests have
|
||||||
/// to be proxied to IPv4 requests, and IPv6 requests to IPv6 requests.
|
/// to be proxied to IPv4 requests, and IPv6 requests to IPv6 requests.
|
||||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
||||||
|
|
|
||||||
|
|
@ -47,13 +47,14 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
|
||||||
let (sentinel_watcher, sentinel) = PanicSentinelWatcher::create_with_sentinel();
|
let (sentinel_watcher, sentinel) = PanicSentinelWatcher::create_with_sentinel();
|
||||||
let priv_dropper = PrivilegeDropper::new(config.privileges.clone(), config.socket_workers);
|
let priv_dropper = PrivilegeDropper::new(config.privileges.clone(), config.socket_workers);
|
||||||
|
|
||||||
let opt_tls_config = config
|
let opt_tls_config = if config.network.enable_tls {
|
||||||
.network
|
Some(Arc::new(create_rustls_config(
|
||||||
.enable_tls
|
|
||||||
.then_some(Arc::new(create_rustls_config(
|
|
||||||
&config.network.tls_certificate_path,
|
&config.network.tls_certificate_path,
|
||||||
&config.network.tls_private_key_path,
|
&config.network.tls_private_key_path,
|
||||||
)?));
|
)?))
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
let mut executors = Vec::new();
|
let mut executors = Vec::new();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue