diff --git a/actix-session/CHANGES.md b/actix-session/CHANGES.md index 4c1138e41..c32126834 100644 --- a/actix-session/CHANGES.md +++ b/actix-session/CHANGES.md @@ -2,6 +2,7 @@ ## Unreleased +- Added support for using `rustls` in `actix-session` instead of `native-tls` - Remove `redis-actor-session` crate feature (and, therefore, the `actix-redis` based storage backend). ## 0.9.0 diff --git a/actix-session/Cargo.toml b/actix-session/Cargo.toml index 38a5ec928..f6d72dd74 100644 --- a/actix-session/Cargo.toml +++ b/actix-session/Cargo.toml @@ -22,6 +22,7 @@ default = [] cookie-session = [] redis-rs-session = ["redis", "rand"] redis-rs-tls-session = ["redis-rs-session", "redis/tokio-native-tls-comp"] +redis-rs-tls-session-rustls = ["redis-rs-session", "redis/tokio-rustls-comp"] [dependencies] actix-service = "2" diff --git a/actix-session/README.md b/actix-session/README.md index ee6fa5b8c..70272a948 100644 --- a/actix-session/README.md +++ b/actix-session/README.md @@ -108,12 +108,20 @@ By default, `actix-session` does not provide any storage backend to retrieve and actix-session = { version = "...", features = ["redis-rs-session"] } ``` - Add the `redis-rs-tls-session` feature flag if you want to connect to Redis using a secured connection: + Add the `redis-rs-tls-session` feature flag if you want to connect to Redis using a secured connection (via the `native-tls` crate): ```toml [dependencies] # ... - actix-session = { version = "...", features = ["redis-rs-session", "redis-rs-tls-session"] } + actix-session = { version = "...", features = ["redis-rs-tls-session"] } + ``` + + If you instead prefer depending on `rustls`, use the `redis-rs-tls-session-rustls` feature flag: + + ```toml + [dependencies] + # ... + actix-session = { version = "...", features = ["redis-rs-tls-session-rustls"] } ``` You can implement your own session storage backend using the [`SessionStore`] trait. diff --git a/actix-session/src/lib.rs b/actix-session/src/lib.rs index 4ad2c5ebe..66696d60b 100644 --- a/actix-session/src/lib.rs +++ b/actix-session/src/lib.rs @@ -116,12 +116,20 @@ attached to your sessions. You can enable: ``` Add the `redis-rs-tls-session` feature flag if you want to connect to Redis using a secured - connection: + connection (via the `native-tls` crate): ```toml [dependencies] # ... - actix-session = { version = "...", features = ["redis-rs-session", "redis-rs-tls-session"] } + actix-session = { version = "...", features = ["redis-rs-tls-session"] } + ``` + + If you instead prefer depending on `rustls`, use the `redis-rs-tls-session-rustls` feature flag: + + ```toml + [dependencies] + # ... + actix-session = { version = "...", features = ["redis-rs-tls-session-rustls"] } ``` You can implement your own session storage backend using the [`SessionStore`] trait. diff --git a/actix-session/src/storage/redis_rs.rs b/actix-session/src/storage/redis_rs.rs index cd0803f3a..34f24d655 100644 --- a/actix-session/src/storage/redis_rs.rs +++ b/actix-session/src/storage/redis_rs.rs @@ -44,7 +44,7 @@ use crate::storage::{ /// ``` /// /// # TLS support -/// Add the `redis-rs-tls-session` feature flag to enable TLS support. You can then establish a TLS +/// Add the `redis-rs-tls-session` or `redis-rs-tls-session-rustls` feature flag to enable TLS support. You can then establish a TLS /// connection to Redis using the `rediss://` URL scheme: /// /// ```no_run