[edge] Device certificates: mTLS on hosts with device_certs only (asked per SNI), chain to the Domi CA bundle and the allow list in the handshake, checked again per request; 403 without one
This commit is contained in:
@@ -94,6 +94,8 @@ pub enum AdminError {
|
||||
pub struct Shared {
|
||||
current: ArcSwap<Runtime>,
|
||||
pub certs: Arc<CertStore>,
|
||||
/// The listener's device-certificate check; its trust follows the runtime.
|
||||
pub devices: Arc<crate::tls::DeviceVerifier>,
|
||||
generation: AtomicU64,
|
||||
changed: tokio::sync::watch::Sender<u64>,
|
||||
trial: Mutex<Option<Trial>>,
|
||||
@@ -133,10 +135,13 @@ impl Shared {
|
||||
};
|
||||
let certs = Arc::new(CertStore::default());
|
||||
certs.replace_files(rt.file_certs.clone());
|
||||
let devices = Arc::new(crate::tls::DeviceVerifier::default());
|
||||
devices.replace(rt.device_trust.clone());
|
||||
let (changed, _) = tokio::sync::watch::channel(1);
|
||||
let s = Arc::new(Shared {
|
||||
current: ArcSwap::from_pointee(rt),
|
||||
certs,
|
||||
devices,
|
||||
generation: AtomicU64::new(1),
|
||||
changed,
|
||||
trial: Mutex::new(None),
|
||||
@@ -182,6 +187,7 @@ impl Shared {
|
||||
|
||||
fn install(&self, rt: Arc<Runtime>) {
|
||||
self.certs.replace_files(rt.file_certs.clone());
|
||||
self.devices.replace(rt.device_trust.clone());
|
||||
self.current.store(rt);
|
||||
self.generation.fetch_add(1, Ordering::SeqCst);
|
||||
self.notify();
|
||||
|
||||
Reference in New Issue
Block a user