Watch for certificate changes from KvStore and update CertStore
(proxy: Proxy)
| 555 | |
| 556 | /// Watch for certificate changes from KvStore and update CertStore |
| 557 | fn start_cert_store_watch_task(proxy: Proxy) { |
| 558 | let kv_store = proxy.kv_store.clone(); |
| 559 | |
| 560 | // Watch for any certificate changes (all domains) |
| 561 | let mut rx = kv_store.watch_all_certs(); |
| 562 | tokio::spawn(async move { |
| 563 | loop { |
| 564 | if rx.changed().await.is_err() { |
| 565 | break; |
| 566 | } |
| 567 | info!("WaveKV: detected certificate changes, reloading CertStore..."); |
| 568 | if let Err(err) = proxy.reload_all_certs_from_kvstore() { |
| 569 | error!("Failed to reload certificates from KvStore: {err:?}"); |
| 570 | } |
| 571 | } |
| 572 | }); |
| 573 | info!("CertStore watch task started"); |
| 574 | } |
| 575 | |
| 576 | /// Watch for ZT-Domain config changes and auto-renew certificates |
| 577 | fn start_zt_domain_watch_task(proxy: Proxy) { |
no test coverage detected