Skip to content

Commit

Permalink
rename instances of TRUSTED CERTIFICATE to CERTIFICATE
Browse files Browse the repository at this point in the history
  • Loading branch information
PratikMahajan committed Aug 28, 2024
1 parent 68ee7f2 commit 023fd09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cincinnati/src/plugins/internal/graph_builder/commons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ pub fn get_certs_from_dir(dir: &Path) -> Fallible<Vec<Certificate>, Error> {
let mut cert_buf = Vec::new();
std::fs::File::open(&path.path())?
.read_to_end(&mut cert_buf)?;
let certificate = reqwest::Certificate::from_pem(&cert_buf);

// rename "TRUSTED CERTIFICATE" to "CERTIFICATE" in case of non-standard trusted certificates
let pem_str = String::from_utf8(cert_buf).unwrap();
let pem_str =
pem_str.replace("TRUSTED CERTIFICATE", "CERTIFICATE");

let certificate =
reqwest::Certificate::from_pem(&pem_str.as_bytes());
if certificate.is_ok() {
debug!(
"Adding {} to certificates",
Expand Down

0 comments on commit 023fd09

Please sign in to comment.