Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replacing a certificate cannot work correctly #313

Closed
Geal opened this issue Dec 29, 2017 · 3 comments
Closed

replacing a certificate cannot work correctly #313

Geal opened this issue Dec 29, 2017 · 3 comments

Comments

@Geal
Copy link
Member

Geal commented Dec 29, 2017

certificates and their related information are stored in two parts:

Currently, if we remove the old certificate then add the new one, there's a gap during which TLS connections with those certificates won't work.
If we add the new certificate then remove the old one, then the adding part would replace the fingerprint in the trie with the new one, and the removing part would remove the new fingerprint from the trie (for all the domain names handled by the old certificate): https://github.com/sozu-proxy/sozu/blob/master/lib/src/network/tls.rs#L718-L720

proposal: store a Vec<CertFingerprint> as value in the trie. That way, when we add or remove, we edit the related vector. If we look up a name and the resulting vec has multiple entries, just take the first one, since it means the certificate is still valid.

@Geal Geal changed the title replacing a certificat cannot work correctly replacing a certificate cannot work correctly Dec 29, 2017
@Geal Geal added this to the needed for the release milestone Dec 29, 2017
@Geal Geal added the bug label Dec 29, 2017
@NotBad4U
Copy link
Contributor

NotBad4U commented Jan 2, 2018

A good way can be to add a new command replaceCertificate.

  • Add new endpoint to cli
  • Add the catch of this Order here
  • Send the command to the workers and manage it here
  • You'll add a new method replace to the trie.rs

@Geal
Copy link
Member Author

Geal commented Jan 2, 2018

for the trie, this will be a normal remove and and add, because the old certificate and the new certificate might not have the same set of DNS names

@Geal
Copy link
Member Author

Geal commented Jan 9, 2018

Fixed by 6dd6f6d

@Geal Geal closed this as completed Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants