-
-
Notifications
You must be signed in to change notification settings - Fork 37
feat: detect and report self-signed certificate error in tls connections #236
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
feat: detect and report self-signed certificate error in tls connections #236
Conversation
…LS connection error
7f67615
to
e2bf18a
Compare
Open to a suggestion of how you would like this to be tested, if needed. |
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.
Pull Request Overview
This PR adds a more helpful error message when encountering self-signed certificate issues in TLS connections, specifically targeting the SELF_SIGNED_CERT_IN_CHAIN
error code. Instead of letting the plugin timeout, users will receive guidance on how to resolve the certificate issue.
- Adds specific error handling for
SELF_SIGNED_CERT_IN_CHAIN
error code - Provides actionable guidance on TLS configuration options
- Treats this as an unrecoverable error similar to existing
ENOTFOUND
handling
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Liam Tait <Liam-Tait@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Liam Tait <Liam-Tait@users.noreply.github.com>
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.
A test is missing.
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.
Looks good to me.
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!
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
Add a more helpful error message when a
"SELF_SIGNED_CERT_IN_CHAIN"
error code occurs, guiding users on how to resolve the issue.Adding an error message for this specific case makes sense to me as the error is unrecoverable much like the
"ENOTFOUND"
case.This error is unrecoverable since ioredis cannot connect unless the TLS
options are changed.
Without this change the error received by the user is the fastify plugin timeout message.
I personally came across this because Heroku Key-Value Store uses self-signed certificates.
Checklist
npm run test && npm run benchmark --if-present
and the Code of conduct