[control] Fix round 1: changes apply while Caddy serves (admin socket, watch through Caddy), revocations that fail are errors and catch up, proof only on the forward-auth UI host, root keys found by content, intermediates checked before install, stale SNI cleared before each handshake

This commit is contained in:
2026-11-08 10:49:31 +01:00
parent 0749119f19
commit e84eb1ba74
36 changed files with 934 additions and 131 deletions
+1
View File
@@ -190,6 +190,7 @@ pub fn spawn(spec: EdgeSpec<'_>) -> Edge {
access_log: dir.str("logs/access.log"),
caddy_credentials_dir: "/run/credentials/caddy-fallback.service".into(),
caddy_admin: None,
caddy_admin_socket: None,
};
let config_text = compile_with(&dir, &ca, &opts, spec.site, &spec.hosts);
std::fs::write(dir.join("edge.json"), &config_text).unwrap();
+10 -2
View File
@@ -1,5 +1,12 @@
// QC (throw-away): the thread-local SNI that DeviceVerifier::offer_client_auth reads.
// In-memory rustls handshakes on ONE thread, with edge's own CertStore + DeviceVerifier.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! The per-SNI certificate request (QC, fix round 1): the thread-local name that
//! DeviceVerifier::offer_client_auth reads, with in-memory rustls handshakes on ONE thread and
//! edge's own CertStore and DeviceVerifier. Each connection starts with
//! `tls::begin_handshake()`, as edge's pre-TLS hook does before Pingora creates the
//! `ServerConnection`.
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
@@ -97,6 +104,7 @@ fn client(w: &World, tls12_only: bool, cert: bool, alpn: &[&[u8]]) -> Arc<Client
/// Returns whether the server saw a client certificate.
fn handshake(sc: &Arc<ServerConfig>, cc: &Arc<ClientConfig>, name: &str) -> Result<bool, String> {
ianitor_edge::tls::begin_handshake();
let mut server = ServerConnection::new(sc.clone()).unwrap();
let mut client =
ClientConnection::new(cc.clone(), ServerName::try_from(name.to_owned()).unwrap()).unwrap();