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: catch directory not found when iterating over OCSP cache #82

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

james-ctc
Copy link
Collaborator

@james-ctc james-ctc commented Jun 17, 2024

Describe your changes

The code exceptions when there OCSP cache directory doesn't exist.
This fix catches the exception so that an error can be logged rather than terminating EVerest

example error prior to fix:

2024-06-17 10:48:57.318956 [INFO] evse_security:E  :: Found valid leaf: ["/home/james/code/everest/workspace/everest-core/build/dist/etc/everest/certs/client/cso/CPO_CERT_CHAIN.pem"]
terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
  what():  filesystem error: directory iterator cannot open directory: No such file or directory [/home/james/code/everest/workspace/everest-core/build/dist/etc/everest/certs/client/cso/ocsp]
2024-06-17 10:48:57.652987 [CRIT] manager         int boot(const boost::program_options::variables_map&) :: Module evse_security (pid: 59760) exited with status: 134. Terminating all modules.
2024-06-17 10:48:57.655044 [INFO] manager          :: SIGTERM of child: api (pid: 59755) succeeded.
...

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@james-ctc james-ctc merged commit b140c17 into main Jun 17, 2024
4 checks passed
@james-ctc james-ctc deleted the fix/exception-on-missing-dir branch September 17, 2024 13:00
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.

2 participants