diff --git a/README.md b/README.md index 2473faa32f..63d767bbda 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/quic/s2n-quic-tests/README.md b/quic/s2n-quic-tests/README.md index 1e7b98f25b..00a25cbcff 100644 --- a/quic/s2n-quic-tests/README.md +++ b/quic/s2n-quic-tests/README.md @@ -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 diff --git a/quic/s2n-quic/src/lib.rs b/quic/s2n-quic/src/lib.rs index d0678fc866..5761724dcc 100644 --- a/quic/s2n-quic/src/lib.rs +++ b/quic/s2n-quic/src/lib.rs @@ -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` //! @@ -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`**