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

fix(http): handle axios error code UNABLE_TO_VERIFY_LEAF_SIGNATURE #1267

Merged

Conversation

syamsudotdev
Copy link
Contributor

Monika Pull Request (PR)

This PR resolves #1266

What feature/issue does this PR add

  1. Handle axios error code UNABLE_TO_VERIFY_LEAF_SIGNATURE

How did you implement / how did you fix it

  1. Map error code UNABLE_TO_VERIFY_LEAF_SIGNATURE to error code 27
  2. Map error code UNABLE_TO_VERIFY_LEAF_SIGNATURE to error codename ELEAFSIGNATURE
  3. Add documentation for error code 27

How to test

  1. Create monika.yml config below
probes:
  - id: 'Example'
    requests:
      - url: https://kemendesa.go.id/
  1. npm run start -- -r 1
  2. On 5th failure, expect to see warning log id:Example ERROR: EINVALIDLEAFSIGN: Unable to verify the first / leaf certificate., NOTIF: Service probably down

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 62.51%. Comparing base (1eb87eb) to head (044bab7).

Files Patch % Lines
src/components/probe/prober/http/request.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1267      +/-   ##
==========================================
- Coverage   62.59%   62.51%   -0.08%     
==========================================
  Files         112      112              
  Lines        3390     3391       +1     
  Branches      591      591              
==========================================
- Hits         2122     2120       -2     
- Misses       1077     1079       +2     
- Partials      191      192       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dennypradipta
Copy link
Contributor

CMIIW, is the UNABLE_TO_VERIFY_LEAF_SIGNATURE the same as the CERT_HAS_EXPIRED?

If by chance it is different, maybe you could add CERT_HAS_EXPIRED as well.

@dennypradipta
Copy link
Contributor

On second thought, the CERT_HAS_EXPIRED happens if you don't use --ignoreInvalidTLS, but UNABLE_TO_VERIFY_LEAF_SIGNATURE still happens. Carry on then

Copy link
Contributor

@dennypradipta dennypradipta 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

@raosan raosan left a comment

Choose a reason for hiding this comment

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

LGTM

@syamsudotdev syamsudotdev merged commit 6a29470 into hyperjumptech:main Apr 5, 2024
9 checks passed
@syamsudotdev syamsudotdev deleted the fix/1266-invalid-leaf-cert branch April 5, 2024 06:16
@syamsudotdev syamsudotdev self-assigned this Apr 5, 2024
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.

Handle CERT_HAS_EXPIRED error
3 participants