Skip to content

Commit

Permalink
Merge pull request #1022 from sozu-proxy/devel/fdubois/fix/replace-ce…
Browse files Browse the repository at this point in the history
…rtificate

fix(tls): do not replace fresh certificate
  • Loading branch information
FlorentinDUBOIS authored Oct 27, 2023
2 parents 039a5e3 + 60bb97e commit 1a3a777
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ pub trait CertificateResolver {
expired_at: opts.new_expired_at.to_owned(),
})?;

self.remove_certificate(&fingerprint)?;
match hex::decode(&opts.old_fingerprint) {
Ok(old_fingerprint) => self.remove_certificate(&Fingerprint(old_fingerprint))?,
Err(err) => {
error!("failed to parse fingerprint, {}", err);
}
}

Ok(fingerprint)
}
Expand Down

0 comments on commit 1a3a777

Please sign in to comment.