expire old SKPI hashes

This commit is contained in:
link2xt
2026-04-16 20:03:46 +02:00
parent 900cb7f7aa
commit 900d88c5eb
4 changed files with 19 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ use anyhow::Result;
use crate::net::session::SessionStream;
use crate::sql::Sql;
use crate::tools::time;
use tokio_rustls::rustls;
use tokio_rustls::rustls::client::ClientSessionStore;
@@ -164,9 +165,10 @@ pub async fn wrap_rustls<'a>(
.peer_certificates()
.and_then(|certs| certs.first())
{
let now = time();
let parsed_certificate = ParsedCertificate::try_from(end_entity)?;
let spki = parsed_certificate.subject_public_key_info();
spki_hash_store.save_spki(hostname, &spki, sql).await?;
spki_hash_store.save_spki(hostname, &spki, sql, now).await?;
}
Ok(tls_stream)