aatxe / irc

the irc crate – usable, async IRC for Rust
Mozilla Public License 2.0
525 stars 100 forks source link

better errors for missing certificates #228

Closed Johann150 closed 3 years ago

Johann150 commented 3 years ago

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.

aatxe commented 3 years ago

Looks good to me, thanks!