aatxe / irc

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

dangerously_accept_invalid_certs option for irc servers with self-signed certs #259

Closed boldaxis closed 6 months ago

boldaxis commented 11 months ago

Using the example given in the readme, it errors because the server I'm trying to connect to uses a self-signed cert. After looking through the repo, it seems like adding the "dangerously_accept_invalid_certs" option is the right thing to do as documented here, but adding it causes the build to fail:

Compiling ircbot v0.1.0 (/home/boldaxis/ircbot)
error[E0560]: struct `irc::client::data::Config` has no field named `dangerously_accept_invalid_certs`
  --> src/main.rs:11:2
   |
11 |     dangerously_accept_invalid_certs: true,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `irc::client::data::Config` does not have this field
   |
   = note: available fields are: `owners`, `nick_password`, `alt_nicks`, `username`, `realname` ... and 21 others

For more information about this error, try `rustc --explain E0560`.
error: could not compile `ircbot` (bin "ircbot") due to previous error

This is what the Config line in my code looks like, it is otherwise unmodified from the example given in the repo:

        let config = Config {
            nickname: Some("testbot".to_owned()),
            server: Some("irc.local".to_owned()),
            channels: vec!["#test".to_owned()],
            dangerously_accept_invalid_certs: true,
            ..Config::default()
        };       

I'm new to Rust and had to dig in the code to find that option so I may simply have misunderstood its usage, any guidance would be helpful. Thank you!

aatxe commented 6 months ago

This is a dupe of #251, a release with this feature has not been published.