Skip to content

Conversation

Liam-Tait
Copy link
Contributor

@Liam-Tait Liam-Tait commented Sep 29, 2025

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

@Liam-Tait Liam-Tait force-pushed the liam/self-signed-cert-in-chain-friendly-message branch from 7f67615 to e2bf18a Compare September 29, 2025 03:37
@Liam-Tait
Copy link
Contributor Author

Liam-Tait commented Sep 29, 2025

Open to a suggestion of how you would like this to be tested, if needed.
Documentation does not need to be changed IMO.

@Uzlopak Uzlopak requested a review from Copilot September 29, 2025 06:27
Copy link
Contributor

@Copilot Copilot AI left a 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.

Liam-Tait and others added 2 commits September 29, 2025 20:18
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>
@Liam-Tait Liam-Tait changed the title feat: provide friendly error message for self-signed certificate in TLS connection error feat: detect and report self-signed certificate error in tls connections Sep 30, 2025
Copy link
Member

@jsumners jsumners left a 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.

Copy link
Member

@jsumners jsumners left a 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.

@jsumners jsumners requested a review from a team October 1, 2025 10:40
@Liam-Tait Liam-Tait requested a review from is2ei October 2, 2025 01:02
Copy link

@is2ei is2ei left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

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

LGTM

@Uzlopak Uzlopak merged commit b29adb6 into fastify:main Oct 2, 2025
13 checks passed
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.

5 participants