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

[FAB-18188] Log orderer and peer cert expiration date upon startup #1804

Merged
merged 1 commit into from
Aug 26, 2020

Conversation

denyeart
Copy link
Contributor

Type of change

  • Improvement (improvement to logging)

Description

FAB-17000 added a warning if expiration is within a week.

This change additionally info logs the future enrollment, tls server, and tls client
cert expiration dates upon startup, regardless of whether they will expire within a week or not.

Signed-off-by: David Enyeart enyeart@us.ibm.com

FAB-17000 added a warning if expiration is within a week.

This change additionally info logs the future enrollment, tls server, and tls client
cert expiration dates upon startup, regardless of whether they will expire within a week or not.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
@denyeart denyeart requested a review from a team as a code owner August 25, 2020 22:24
Copy link
Contributor

@yacovm yacovm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why modify the current code and make it even more complex.

Why not just export certExpirationTime and log it outside?

@denyeart
Copy link
Contributor Author

@yacovm Because each of the three certs have checks against them in TrackExpiration, as does certExpirationTime(). Why duplicate all those checks and add complexity to the peer and orderer mains, when it can be done together with the existing logging in the dedicated expiration tracking function where people would expect it. At the end of the day, I don't think it matters much either way, but mostly I'd prefer to keep the mains nice and clean.

@yacovm
Copy link
Contributor

yacovm commented Aug 26, 2020

@yacovm Because each of the three certs have checks against them in TrackExpiration, as does certExpirationTime(). Why duplicate all those checks and add complexity to the peer and orderer mains, when it can be done together with the existing logging in the dedicated expiration tracking function where people would expect it. At the end of the day, I don't think it matters much either way, but mostly I'd prefer to keep the mains nice and clean.

I think that if you make a single function that accepts all 3 as inputs (similar to track expiration) then it won't pollute the main, and will be much easier to understand the code.

@denyeart
Copy link
Contributor Author

@yacovm Because each of the three certs have checks against them in TrackExpiration, as does certExpirationTime(). Why duplicate all those checks and add complexity to the peer and orderer mains, when it can be done together with the existing logging in the dedicated expiration tracking function where people would expect it. At the end of the day, I don't think it matters much either way, but mostly I'd prefer to keep the mains nice and clean.

I think that if you make a single function that accepts all 3 as inputs (similar to track expiration) then it won't pollute the main, and will be much easier to understand the code.

@yacovm But all three cert expiration dates are not available for logging, it depends on which are configured on the node. By the time we duplicate that logic, might as well just log it alongside the expiration Warning where I have it. I'm not seeing the complexity of keeping the expiration warning and expiration logging co-located in trackCertExpiration(), on the contrary it seems that a trackCertExpiration() function is the most straightforward place to both log the date and provide a warning if the date is coming soon.

@yacovm yacovm merged commit bd7180c into hyperledger:master Aug 26, 2020
@denyeart
Copy link
Contributor Author

@Mergifyio backport release-2.2

@denyeart
Copy link
Contributor Author

@Mergifyio backport release-2.1

@denyeart
Copy link
Contributor Author

@Mergifyio backport release-2.0

@denyeart denyeart deleted the log_expiration_date branch August 26, 2020 13:41
mergify bot pushed a commit that referenced this pull request Aug 26, 2020
…1804)

FAB-17000 added a warning if expiration is within a week.

This change additionally info logs the future enrollment, tls server, and tls client
cert expiration dates upon startup, regardless of whether they will expire within a week or not.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
(cherry picked from commit bd7180c)
@mergify
Copy link

mergify bot commented Aug 26, 2020

Command backport release-2.2: success

Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 26, 2020
…1804)

FAB-17000 added a warning if expiration is within a week.

This change additionally info logs the future enrollment, tls server, and tls client
cert expiration dates upon startup, regardless of whether they will expire within a week or not.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
(cherry picked from commit bd7180c)
@mergify
Copy link

mergify bot commented Aug 26, 2020

Command backport release-2.1: success

Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 26, 2020
…1804)

FAB-17000 added a warning if expiration is within a week.

This change additionally info logs the future enrollment, tls server, and tls client
cert expiration dates upon startup, regardless of whether they will expire within a week or not.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
(cherry picked from commit bd7180c)
@mergify
Copy link

mergify bot commented Aug 26, 2020

Command backport release-2.0: success

Backports have been created

denyeart added a commit to denyeart/fabric that referenced this pull request Aug 26, 2020
…yperledger#1804)

FAB-17000 added a warning if expiration is within a week.

This change additionally info logs the future enrollment, tls server, and tls client
cert expiration dates upon startup, regardless of whether they will expire within a week or not.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
denyeart added a commit to denyeart/fabric that referenced this pull request Aug 26, 2020
…yperledger#1804)

FAB-17000 added a warning if expiration is within a week.

This change additionally info logs the future enrollment, tls server, and tls client
cert expiration dates upon startup, regardless of whether they will expire within a week or not.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
lindluni pushed a commit that referenced this pull request Aug 26, 2020
…1804)

FAB-17000 added a warning if expiration is within a week.

This change additionally info logs the future enrollment, tls server, and tls client
cert expiration dates upon startup, regardless of whether they will expire within a week or not.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
(cherry picked from commit bd7180c)
lindluni pushed a commit that referenced this pull request Aug 26, 2020
…1804)

FAB-17000 added a warning if expiration is within a week.

This change additionally info logs the future enrollment, tls server, and tls client
cert expiration dates upon startup, regardless of whether they will expire within a week or not.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants