feat: wip - configuration design

This commit is contained in:
Jun Kurihara 2024-07-12 23:50:37 +09:00
commit 887e6b64b0
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
13 changed files with 173 additions and 11 deletions

View file

@ -46,10 +46,13 @@ impl Reload<ServerCryptoBase> for CryptoReloader {
let mut server_crypto_base = ServerCryptoBase::default();
for (server_name_bytes, crypto_source) in self.inner.iter() {
let certs_keys = crypto_source.read().await.map_err(|e| {
error!("Failed to reload cert, key or ca cert: {e}");
ReloaderError::<ServerCryptoBase>::Reload("Failed to reload cert, key or ca cert")
})?;
let certs_keys = match crypto_source.read().await {
Ok(certs_keys) => certs_keys,
Err(e) => {
error!("Failed to read certs and keys, skip at this time: {}", e);
continue;
}
};
server_crypto_base.inner.insert(server_name_bytes.clone(), certs_keys);
}