1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 00:21:08 +01:00

awc: gate TlsConnectorService behind any feature that uses it (#3350)

This commit is contained in:
asonix 2024-05-13 23:57:58 -05:00 committed by GitHub
parent c1a6388614
commit 44f502e050
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -3,6 +3,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.72. - Minimum supported Rust version (MSRV) is now 1.72.
- Fix warning on 1.78 due to unused TlsConnectorService struct
## 3.4.0 ## 3.4.0

View File

@ -649,6 +649,14 @@ where
/// service for establish tcp connection and do client tls handshake. /// service for establish tcp connection and do client tls handshake.
/// operation is canceled when timeout limit reached. /// operation is canceled when timeout limit reached.
#[cfg(any(
feature = "dangerous-h2c",
feature = "openssl",
feature = "rustls-0_20",
feature = "rustls-0_21",
feature = "rustls-0_22-webpki-roots",
feature = "rustls-0_22-native-roots",
))]
struct TlsConnectorService<Tcp, Tls> { struct TlsConnectorService<Tcp, Tls> {
/// TCP connection is canceled on `TcpConnectorInnerService`'s timeout setting. /// TCP connection is canceled on `TcpConnectorInnerService`'s timeout setting.
tcp_service: Tcp, tcp_service: Tcp,
@ -659,6 +667,14 @@ struct TlsConnectorService<Tcp, Tls> {
timeout: Duration, timeout: Duration,
} }
#[cfg(any(
feature = "dangerous-h2c",
feature = "openssl",
feature = "rustls-0_20",
feature = "rustls-0_21",
feature = "rustls-0_22-webpki-roots",
feature = "rustls-0_22-native-roots",
))]
impl<Tcp, Tls, IO> Service<Connect> for TlsConnectorService<Tcp, Tls> impl<Tcp, Tls, IO> Service<Connect> for TlsConnectorService<Tcp, Tls>
where where
Tcp: Tcp: