-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add support for clearing old certificates during reconnect #919
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm not going to accept this because it's not necessary. Just make another Options. I do like the other changes, the comment fixes and the nameof for instance, so you are welcome to resubmit with only those changes.
/// <param name="nkeySeedText">The text containing the "-----BEGIN USER NKEY SEED-----" block or the seed begining with "SU". | ||
/// May be the same as the jwt string if they are chained.</param> | ||
/// <param name="nkeySeedText">The text containing the "-----BEGIN USER NKEY SEED-----" block or the seed beginning with "SU". | ||
/// Maybe the same as the jwt string if they are chained.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"May be" was correct here. How about, "Both string can contain both the credentials and jwt block since they will be parsed for the required data."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not have time to make this change according to your suggestion before this PR was merged.
Do you want me to make a new PR to fix this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the slow response, yeah, please fix when you get a chance. I'll make a release as soon as you do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, sorry for the even slower response. Will make a new PR this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR is now created: #925
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The
Options
object does not provide a way to remove once added certificates.This leads to that in case of certificate renewals the connection needs to be closed and recreated, including recreating all subscriptions. Just adding the new certificate and trying to reconnect with the old no longer relevant certificate and the new certificate in the certificate collection will make the connection fail on the TLS handshake.
Without a way to clear the certificates, reflection is required to get access to the internal
certificates
field which can be problematic.By enabling library user to clear the certificates field through
ClearCertificates()
and adding the new certificate, the connection can use the correct certificate during the next connection retry (if retrial is configured).This can be done for example in a user provided
ReconnectDelayHandler
method.Other changes:
nameof()