Skip to content

Commit

Permalink
Update certificate replacement behaviour (#762)
Browse files Browse the repository at this point in the history
* See issue #712

Signed-off-by: Florentin Dubois <florentin.dubois@clever-cloud.com>
  • Loading branch information
FlorentinDUBOIS committed Jul 13, 2022
1 parent ce80563 commit 7276e17
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ pub trait CertificateResolver {
&mut self,
opts: &ReplaceCertificate,
) -> Result<CertificateFingerprint, Self::Error> {
self.remove_certificate(&RemoveCertificate {
address: opts.address.to_owned(),
fingerprint: opts.old_fingerprint.to_owned(),
})?;

let fingerprint = self.add_certificate(&AddCertificate {
address: opts.address.to_owned(),
certificate: opts.new_certificate.to_owned(),
names: opts.new_names.to_owned(),
expired_at: opts.new_expired_at.to_owned(),
})?;

self.remove_certificate(&RemoveCertificate {
address: opts.address.to_owned(),
fingerprint: opts.old_fingerprint.to_owned(),
})?;

Ok(fingerprint)
}
}
Expand Down

0 comments on commit 7276e17

Please sign in to comment.