IronRDP/crates/ironrdp-tls
Benoît Cortier 48e02441d2
chore: update Rust toolchain to 1.88.0 (#852)
MSRV is also bumped to 1.84.
2025-07-03 07:38:28 +03:00
..
src chore: update Rust toolchain to 1.88.0 (#852) 2025-07-03 07:38:28 +03:00
Cargo.toml chore(release): prepare for publishing (#748) 2025-05-27 15:21:56 +00:00
CHANGELOG.md chore(release): prepare for publishing (#628) 2025-01-28 23:24:35 +00:00
LICENSE-APACHE chore: symlinks to license files in packages (#604) 2024-12-11 08:13:26 -05:00
LICENSE-MIT chore: symlinks to license files in packages (#604) 2024-12-11 08:13:26 -05:00
README.md docs: add project links to READMEs for consistency 2024-10-29 19:14:20 +09:00

IronRDP TLS

TLS boilerplate common with most IronRDP clients.

This crate exposes three features for selecting the TLS backend:

  • rustls: use the rustls crate.
  • native-tls: use the native-tls crate.
  • stub: use a stubbed backend which fail at runtime when used.

These features are mutually exclusive and only one may be enabled at a time. When more than one backend is enabled, a compile-time error is emitted. For this reason, no feature is enabled by default.

The rationale is two-fold:

  • It makes deliberate the choice of the TLS backend.
  • It eliminates the risk of mistakenly enabling multiple backends at once.

With this approach, its obvious which backend is enabled when looking at the dependency declaration:

# This:
ironrdp-tls = { version = "x.y.z", features = ["rustls"] }

# Instead of:
ironrdp-tls = "x.y.z"

There is also no default feature to disable:

# This:
ironrdp-tls = { version = "x.y.z", features = ["native-tls"] }

# Instead of:
ironrdp-tls = { version = "x.y.z", default-features = false, features = ["native-tls"] }

This is typically more convenient and less error-prone when re-exposing the features from another crate.

[features]
rustls = ["ironrdp-tls/rustls"]
native-tls = ["ironrdp-tls/native-tls"]
stub-tls = ["ironrdp-tls/stub"]

# This:
[dependencies]
ironrdp-tls = "x.y.z"

# Instead of:
[dependencies]
ironrdp-tls = { version = "x.y.z", default-features = false }

(This is worse when the crate is exposing other default features which are typically not disabled by default.)

The stubbed backend is provided as an easy way to make the code compiles with minimal dependencies if required.

This crate is part of the IronRDP project.