Add TLS transport support

Connect over TLS (default port 6697) using native-tls with the system
OpenSSL trust store for certificate verification. Unify the plaintext and
TLS transports behind a single Box<dyn Read + Write>, dropping the
read/write socket clone that a TLS session cannot support. Add a `tls`
config key and IRC_TLS override; the port auto-defaults to 6697 when TLS
is enabled.
This commit is contained in:
Jean Chevronnet 2026-07-28 14:57:44 +00:00
parent 05c004d32d
commit ab02a5436e
5 changed files with 78 additions and 28 deletions

View file

@ -10,9 +10,12 @@ authors = ["a.srenov"]
name = "rustbot"
path = "src/main.rs"
# Intentionally dependency-free. The IRC protocol layer lives in `src/irc.rs`
# and follows the modern IRC client spec: https://modern.ircdocs.horse/
# The IRC protocol layer is hand-rolled in `src/irc.rs` (modern IRC client
# spec: https://modern.ircdocs.horse/). The sole dependency is native-tls for
# the optional TLS transport; it wraps the system OpenSSL, so TLS security
# fixes arrive through normal OS updates rather than a vendored crypto crate.
[dependencies]
native-tls = "0.2"
[profile.release]
lto = true