mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 19:06:35 +03:00
expire old SKPI hashes
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user