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

Improve error message for invalid consenter cert #2587

Merged
merged 1 commit into from
May 13, 2021

Conversation

denyeart
Copy link
Contributor

When channel config had an invalid consenter cert, the error message did not indicate which cert was being verified.
The error message now indicates that a consenter cert is invalid, and which consenter cert is invalid.

Signed-off-by: David Enyeart [email protected]

@denyeart denyeart requested a review from a team as a code owner May 12, 2021 15:54
@@ -247,7 +247,7 @@ func VerifyConfigMetadata(metadata *etcdraft.ConfigMetadata, verifyOpts x509.Ver
return errors.Errorf("metadata has nil consenter")
}
if err := validateConsenterTLSCerts(consenter, verifyOpts, true); err != nil {
return err
return errors.Wrapf(err, "consenter %s:%d has invalid certificate", consenter.Host, consenter.Port)
Copy link
Contributor

Choose a reason for hiding this comment

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

errors.WithMessagef would be a better choice, as the underlying error is generated by the fabric code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

When channel config had an invalid consenter cert, the error message did not indicate which cert was being verified.
The error message now indicates that a consenter cert is invalid, and which consenter cert is invalid.

Signed-off-by: David Enyeart <[email protected]>
@denyeart denyeart force-pushed the improve_consenter_cert_err branch from f0a5b5b to 583270a Compare May 13, 2021 20:52
@yacovm yacovm merged commit dbf7eb1 into hyperledger:main May 13, 2021
@denyeart
Copy link
Contributor Author

@Mergifyio backport release-2.3

@denyeart
Copy link
Contributor Author

@Mergifyio backport release-2.2

mergify bot pushed a commit that referenced this pull request May 14, 2021
When channel config had an invalid consenter cert, the error message did not indicate which cert was being verified.
The error message now indicates that a consenter cert is invalid, and which consenter cert is invalid.

Signed-off-by: David Enyeart <[email protected]>
(cherry picked from commit dbf7eb1)
@mergify
Copy link

mergify bot commented May 14, 2021

Command backport release-2.3: success

Backports have been created

mergify bot pushed a commit that referenced this pull request May 14, 2021
When channel config had an invalid consenter cert, the error message did not indicate which cert was being verified.
The error message now indicates that a consenter cert is invalid, and which consenter cert is invalid.

Signed-off-by: David Enyeart <[email protected]>
(cherry picked from commit dbf7eb1)
@mergify
Copy link

mergify bot commented May 14, 2021

Command backport release-2.2: success

Backports have been created

denyeart added a commit that referenced this pull request May 14, 2021
When channel config had an invalid consenter cert, the error message did not indicate which cert was being verified.
The error message now indicates that a consenter cert is invalid, and which consenter cert is invalid.

Signed-off-by: David Enyeart <[email protected]>
(cherry picked from commit dbf7eb1)
denyeart added a commit that referenced this pull request May 14, 2021
When channel config had an invalid consenter cert, the error message did not indicate which cert was being verified.
The error message now indicates that a consenter cert is invalid, and which consenter cert is invalid.

Signed-off-by: David Enyeart <[email protected]>
(cherry picked from commit dbf7eb1)
C0rWin pushed a commit to C0rWin/fabric that referenced this pull request Sep 24, 2022
When channel config had an invalid consenter cert, the error message did not indicate which cert was being verified.
The error message now indicates that a consenter cert is invalid, and which consenter cert is invalid.

Signed-off-by: David Enyeart <[email protected]>
(cherry picked from commit dbf7eb1)
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.

4 participants