Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ See the [API documentation](https://docs.rs/s2n-quic), [examples](https://github
s2n-quic = "1"
```

**NOTE**: On unix-like systems, [`s2n-tls`](https://github.com/aws/s2n-tls) will be used as the default TLS provider.
**NOTE**: The default TLS provider depends on the platform. On unix-like systems, and on Windows
when building with the GNU/MinGW toolchain, [`s2n-tls`](https://github.com/aws/s2n-tls) is used as
the default TLS provider. On Windows with the MSVC toolchain,
[`rustls`](https://crates.io/crates/rustls) is the default, because `s2n-tls` does not build with
MSVC.

On linux systems, [`aws-lc-rs`](https://github.com/awslabs/aws-lc-rs) will be used for cryptographic
operations. A C compiler and CMake may be required on these systems for installation.

Expand Down
14 changes: 10 additions & 4 deletions quic/s2n-quic-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ To further increase performance, the tests are contained within the `src` folder

### Platform-specific Tests

Some tests in this crate are platform-specific, particularly those that depend on s2n-tls, which is only available on Unix systems. These tests are conditionally compiled using `cfg[unix]` attributes. For example:
Some tests in this crate are platform-specific. Most notably, tests that depend on the s2n-tls provider are gated on the `s2n_tls_provider` cfg, which the crate's `build.rs` emits on the targets where s2n-tls builds: unix and Windows with the GNU/MinGW toolchain (but not MSVC). For example:

```rust
// Needs the s2n-tls provider (mTLS, the ClientHelloCallback trait, session resumption).
#[cfg(s2n_tls_provider)]
mod mtls;

// The s2n-tls `fips` feature depends on aws-lc-fips-sys, which does not build on Windows MinGW.
#[cfg(unix)]
mod resumption;
mod fips;

// Uses real OS sockets, which conflict with bach's simulated time on Windows.
#[cfg(not(target_os = "windows"))]
mod mtls;
mod prioritized_socket;
```

This approach ensures that tests only run on platforms where their dependencies are available. The Cargo.toml file also includes platform-specific dependencies to support this.
This ensures tests only build on platforms where their dependencies are available. `Cargo.toml` gates the s2n-tls dependencies to the same targets; keep those in sync with the `s2n_tls_provider` cfg in `build.rs`.

## Test Structure

Expand Down
5 changes: 4 additions & 1 deletion quic/s2n-quic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
//! _Enabled by default_
//!
//! Enables platform detection for the recommended implementation of TLS. Currently, this uses
//! [`s2n-tls`][s2n-tls] on unix-like platforms and [`rustls`][rustls] on everything else.
//! [`s2n-tls`][s2n-tls] on unix-like platforms and on Windows with the GNU/MinGW toolchain, and
//! [`rustls`][rustls] on everything else (notably Windows with the MSVC toolchain).
//!
//! ### `provider-tls-rustls`
//!
Expand All @@ -50,6 +51,8 @@
//!
//! **NOTE**: this will override the platform detection and always use [`s2n-tls`][s2n-tls] by default.
//!
//! **NOTE**: on Windows, [`s2n-tls`][s2n-tls] only builds with the GNU/MinGW toolchain it does not build with the MSVC toolchain.
//!
//! ### `provider-tls-fips`
//!
//! **FIPS mode with `provider-tls-s2n`**
Expand Down
Loading