wip: started to integrate rpxy-certs to rpxy-lib

This commit is contained in:
Jun Kurihara 2024-05-28 20:03:46 +09:00
commit 2f9f0a1122
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
8 changed files with 81 additions and 32 deletions

View file

@ -97,13 +97,16 @@ pub fn build_settings(config: &ConfigToml) -> std::result::Result<(ProxyConfig,
pub async fn build_cert_manager(
config: &ConfigToml,
) -> Result<
(
Option<(
ReloaderService<CryptoReloader, ServerCryptoBase>,
ReloaderReceiver<ServerCryptoBase>,
),
)>,
anyhow::Error,
> {
let apps = config.apps.as_ref().ok_or(anyhow!("No apps"))?;
if config.listen_port_tls.is_none() {
return Ok(None);
}
let mut crypto_source_map = HashMap::default();
for app in apps.0.values() {
if let Some(tls) = app.tls.as_ref() {
@ -118,5 +121,5 @@ pub async fn build_cert_manager(
}
}
let res = build_cert_reloader(&crypto_source_map, None).await?;
Ok(res)
Ok(Some(res))
}