Skip to content

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

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

fix: show actionable SSL certificate error message for corporate proxy failures#396
sonukapoor merged 2 commits into
mainfrom
bugfix/issue-394-ssl-error-message

Conversation

@sonukapoor
Copy link
Copy Markdown
Collaborator

Behind a corporate SSL inspection proxy, OSV network calls fail with a raw Node.js error (self-signed certificate in certificate chain) that gives the user no guidance on what to do.

This PR catches SSL certificate errors and replaces the raw message with clear, actionable steps:

Hint: SSL certificate error — your network may be using a corporate proxy that intercepts HTTPS traffic.
Fix 1 (recommended): trust your corporate CA certificate:
  NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.crt cve-lite .
Fix 2 (quick workaround, not recommended for production): disable TLS verification:
  NODE_TLS_REJECT_UNAUTHORIZED=0 cve-lite .

Changes:

  • Added isSslCertificateError() to src/utils/network.ts covering all common Node.js TLS error codes (SELF_SIGNED_CERT_IN_CHAIN, CERT_UNTRUSTED, UNABLE_TO_VERIFY_LEAF_SIGNATURE, DEPTH_ZERO_SELF_SIGNED_CERT, CERT_HAS_EXPIRED)
  • Updated main().catch in src/index.ts to check for SSL errors first and show the targeted message before falling through to the generic blocked-network hint
  • Added tests for all SSL error variants and confirmed non-SSL errors are unaffected

Closes #394

@sonukapoor sonukapoor merged commit 0aa9f1e into main May 22, 2026
6 checks passed
@sonukapoor sonukapoor deleted the bugfix/issue-394-ssl-error-message branch May 22, 2026 20:48
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