diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index faf66e27c..d46b56983 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -17,6 +17,7 @@ * Remove `HttpResponseBuilder::json2()` and make `HttpResponseBuilder::json()` take a value by reference. [#1903] * `client::error::ConnectError` Resolver variant contains `Box` type [#1905] +* `client::ConnectorConfig` default timeout changed to 5 seconds. [#1905] ### Removed * `ResponseBuilder::set`; use `ResponseBuilder::insert_header`. [#1869] diff --git a/actix-http/src/client/config.rs b/actix-http/src/client/config.rs index 369732964..fad902d04 100644 --- a/actix-http/src/client/config.rs +++ b/actix-http/src/client/config.rs @@ -18,7 +18,7 @@ pub(crate) struct ConnectorConfig { impl Default for ConnectorConfig { fn default() -> Self { Self { - timeout: Duration::from_secs(1), + timeout: Duration::from_secs(5), conn_lifetime: Duration::from_secs(75), conn_keep_alive: Duration::from_secs(15), disconnect_timeout: Some(Duration::from_millis(3000)), diff --git a/actix-http/src/client/connector.rs b/actix-http/src/client/connector.rs index 3581ebe75..425ee0f70 100644 --- a/actix-http/src/client/connector.rs +++ b/actix-http/src/client/connector.rs @@ -100,9 +100,9 @@ impl Connector<(), ()> { fn build_ssl(protocols: Vec>) -> SslConnector { let mut config = ClientConfig::new(); config.set_protocols(&protocols); - config - .root_store - .add_server_trust_anchors(&actix_tls::accept::rustls::TLS_SERVER_ROOTS); + config.root_store.add_server_trust_anchors( + &actix_tls::connect::ssl::rustls::TLS_SERVER_ROOTS, + ); SslConnector::Rustls(Arc::new(config)) } diff --git a/awc/CHANGES.md b/awc/CHANGES.md index c5c1185be..16ec7ad1a 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -5,6 +5,9 @@ * `ClientRequest::insert_header` method which allows using typed headers. [#1869] * `ClientRequest::append_header` method which allows using typed headers. [#1869] +### Changed +* Relax default timeout for `Connector` to 5 seconds(original 1 second). [#1905] + ### Removed * `ClientRequest::set`; use `ClientRequest::insert_header`. [#1869] * `ClientRequest::set_header`; use `ClientRequest::insert_header`. [#1869] @@ -12,6 +15,7 @@ * `ClientRequest::header`; use `ClientRequest::append_header`. [#1869] [#1869]: https://github.com/actix/actix-web/pull/1869 +[#1905]: https://github.com/actix/actix-web/pull/1905 ## 3.0.0-beta.1 - 2021-01-07