chore: refactor rpxy-certs

This commit is contained in:
Jun Kurihara 2025-06-30 17:37:06 +09:00
commit 254b5c1bb1
No known key found for this signature in database
GPG key ID: 9C5AF0A526862FEF
2 changed files with 52 additions and 61 deletions

View file

@ -75,9 +75,7 @@ impl SingleServerCertsKeys {
/* ------------------------------------------------ */
/// Parse the client CA certificates and return a hashmap of pairs of a subject key identifier (key) and a trust anchor (value)
pub fn rustls_client_certs_trust_anchors(&self) -> Result<TrustAnchors, RpxyCertError> {
let Some(certs) = self.client_ca_certs.as_ref() else {
return Err(RpxyCertError::NoClientCert);
};
let certs = self.client_ca_certs.as_ref().ok_or(RpxyCertError::NoClientCert)?;
let certs = certs.iter().map(|c| Certificate::from(c.to_vec())).collect::<Vec<_>>();
let trust_anchors = certs