[control] Domi CA and UI sign-in: intermediate renewal by CSR with manual offline signing, domi host certificates, device requests approved by code, one-time PKCS#12 installs, revocation; Remote-User trusted only with edge's per-boot proof
This commit is contained in:
@@ -131,7 +131,9 @@ impl ProxyHttp for EdgeProxy {
|
||||
let rt = self.shared.current();
|
||||
ctx.rt = Some(rt.clone());
|
||||
ctx.host_header = host_header(session.req_header());
|
||||
if rt.device_trust.is_some() && sni_mismatch(session, &hostname(&ctx.host_header)) {
|
||||
if self.shared.devices.current().is_some()
|
||||
&& sni_mismatch(session, &hostname(&ctx.host_header))
|
||||
{
|
||||
// Like Caddy once client certificates are configured: a request for another host
|
||||
// than the one the TLS connection was opened for is refused, so a connection
|
||||
// that was never asked for a certificate cannot reach a device host.
|
||||
@@ -144,7 +146,7 @@ impl ProxyHttp for EdgeProxy {
|
||||
};
|
||||
ctx.host = Some(host.clone());
|
||||
|
||||
if host.cfg.device_certs && !has_allowed_device_cert(session, &rt) {
|
||||
if host.cfg.device_certs && !has_allowed_device_cert(session, &self.shared) {
|
||||
// No certificate on this connection (one that is presented but not allowed never
|
||||
// gets here: the handshake fails). Same as Caddy's route: 403, nothing upstream.
|
||||
respond_empty(session, 403).await?;
|
||||
@@ -441,8 +443,8 @@ fn sni_mismatch(session: &Session, host: &str) -> bool {
|
||||
/// Did this connection present a device certificate that the current config allows? The
|
||||
/// handshake already checked the chain and the list; this checks again against the runtime
|
||||
/// serving the request, so a revocation also ends requests on connections made before it.
|
||||
fn has_allowed_device_cert(session: &Session, rt: &crate::runtime::Runtime) -> bool {
|
||||
let Some(trust) = rt.device_trust.as_ref() else {
|
||||
fn has_allowed_device_cert(session: &Session, shared: &crate::shared::Shared) -> bool {
|
||||
let Some(trust) = shared.devices.current() else {
|
||||
return false;
|
||||
};
|
||||
session
|
||||
|
||||
Reference in New Issue
Block a user