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

better errors for missing certificates #228

Merged
merged 2 commits into from
Jan 19, 2021
Merged

better errors for missing certificates #228

merged 2 commits into from
Jan 19, 2021

Conversation

Johann150
Copy link
Contributor

Resolves #212.

This introduces a new ConfigError variant for when the configuration contains a path but the respective file cannot be read (could be because the file is missing or because of permission problems). This new variant is then used if a specified certificate file (server or client certificate) cannot be read.

To not duplicate code, I changed the visibility of Config::path to pub(crate) so it can be reused in the variants of Connection::new_secured_transport.

Not sure if or how to add tests for this.

This should be used when the config contains a path but that file cannot be read.
made config::path pub(crate) to avoid code duplication
but not pub so it is not part of the public API
@aatxe
Copy link
Owner

aatxe commented Jan 19, 2021

Looks good to me, thanks!

@aatxe aatxe merged commit 6e985a0 into aatxe:develop Jan 19, 2021
@Johann150 Johann150 deleted the missing-certificates branch January 20, 2021 21:36
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.

Too generic error: "No such file or directory" when loading the config file...and a certificate file.
2 participants