fix optional config section related
split api/client well_known simplify well_known config access Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
5f1cab6850
commit
f30b08f015
9 changed files with 144 additions and 138 deletions
|
@ -23,7 +23,7 @@ pub(super) async fn serve(
|
|||
|
||||
if cfg!(unix) && config.unix_socket_path.is_some() {
|
||||
unix::serve(server, app, shutdown).await
|
||||
} else if config.tls.is_some() {
|
||||
} else if config.tls.certs.is_some() {
|
||||
#[cfg(feature = "direct_tls")]
|
||||
return tls::serve(server, app, handle, addrs).await;
|
||||
|
||||
|
|
|
@ -6,17 +6,20 @@ use axum_server_dual_protocol::{
|
|||
axum_server::{bind_rustls, tls_rustls::RustlsConfig},
|
||||
ServerExt,
|
||||
};
|
||||
use conduit::{Result, Server};
|
||||
use conduit::{err, Result, Server};
|
||||
use tokio::task::JoinSet;
|
||||
use tracing::{debug, info, warn};
|
||||
|
||||
pub(super) async fn serve(
|
||||
server: &Arc<Server>, app: Router, handle: ServerHandle, addrs: Vec<SocketAddr>,
|
||||
) -> Result<()> {
|
||||
let config = &server.config;
|
||||
let tls = config.tls.as_ref().expect("TLS configuration");
|
||||
let certs = &tls.certs;
|
||||
let key = &tls.key;
|
||||
pub(super) async fn serve(server: &Arc<Server>, app: Router, handle: ServerHandle, addrs: Vec<SocketAddr>) -> Result {
|
||||
let tls = &server.config.tls;
|
||||
let certs = tls
|
||||
.certs
|
||||
.as_ref()
|
||||
.ok_or(err!(Config("tls.certs", "Missing required value in tls config section")))?;
|
||||
let key = tls
|
||||
.key
|
||||
.as_ref()
|
||||
.ok_or(err!(Config("tls.key", "Missing required value in tls config section")))?;
|
||||
|
||||
// we use ring for ruma and hashing state, but aws-lc-rs is the new default.
|
||||
// without this, TLS mode will panic.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue