Skip to content

fix: walk error cause chain and add no-hyphen SSL certificate error variant#398

Merged
sonukapoor merged 2 commits into
mainfrom
bugfix/issue-394-ssl-error-cause-chain
May 22, 2026
Merged

fix: walk error cause chain and add no-hyphen SSL certificate error variant#398
sonukapoor merged 2 commits into
mainfrom
bugfix/issue-394-ssl-error-cause-chain

Conversation

@sonukapoor
Copy link
Copy Markdown
Collaborator

Follow-up to #394. The SSL error hint was not showing on some corporate machines for two reasons:

  1. No-hyphen variant missing — Node.js produces "self signed certificate in certificate chain" (no hyphen) but the matcher only checked "self-signed certificate" (with hyphen). Both variants are now covered.

  2. Error cause chain not walked — Node.js fetch wraps the SSL error in a cause chain: the top-level error says "fetch failed" and the SSL detail is in error.cause.message. The previous implementation only read error.message, missing the cause. Added extractErrorMessage() to network.ts that recursively walks the cause chain, and updated both catch blocks in osv-advisory-source.ts to use it.

Closes #394

@sonukapoor sonukapoor merged commit 86abed9 into main May 22, 2026
6 checks passed
@sonukapoor sonukapoor deleted the bugfix/issue-394-ssl-error-cause-chain branch May 22, 2026 21:17
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.

fix: show actionable SSL error message for corporate proxy certificate failures

1 participant