diff --git a/actix-http-test/src/lib.rs b/actix-http-test/src/lib.rs index e7e479ab..03239ece 100644 --- a/actix-http-test/src/lib.rs +++ b/actix-http-test/src/lib.rs @@ -107,7 +107,7 @@ pub async fn test_server_with_addr>( Connector::new() .conn_lifetime(Duration::from_secs(0)) .timeout(Duration::from_millis(30000)) - .ssl(builder.build()) + .openssl(builder.build()) }; #[cfg(not(feature = "openssl"))] diff --git a/actix-test/src/lib.rs b/actix-test/src/lib.rs index 934b8f3a..ac4e904f 100644 --- a/actix-test/src/lib.rs +++ b/actix-test/src/lib.rs @@ -341,7 +341,7 @@ where Connector::new() .conn_lifetime(Duration::from_secs(0)) .timeout(Duration::from_millis(30000)) - .ssl(builder.build()) + .openssl(builder.build()) } #[cfg(not(feature = "openssl"))] { diff --git a/awc/CHANGES.md b/awc/CHANGES.md index 6e1c93dd..600464a2 100644 --- a/awc/CHANGES.md +++ b/awc/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2021-xx-xx +* Rename `Connector::{ssl => openssl}`. [#2503] * Improve `Client` instantiation efficiency when using `openssl` by only building connectors once. [#2503] [#2503]: https://github.com/actix/actix-web/pull/2503 diff --git a/awc/Cargo.toml b/awc/Cargo.toml index ed1196f6..f5c2eef1 100644 --- a/awc/Cargo.toml +++ b/awc/Cargo.toml @@ -62,7 +62,7 @@ actix-codec = "0.4.1" actix-service = "2.0.0" actix-http = "3.0.0-beta.14" actix-rt = { version = "2.1", default-features = false } -actix-tls = { version = "3.0.0-rc.1", features = ["connect", "uri"] } +actix-tls = { version = "3.0.0-rc.2", features = ["connect", "uri"] } actix-utils = "3.0.0" ahash = "0.7" diff --git a/awc/src/client/connector.rs b/awc/src/client/connector.rs index 5a5bce21..f1d4f27f 100644 --- a/awc/src/client/connector.rs +++ b/awc/src/client/connector.rs @@ -38,10 +38,10 @@ enum OurTlsConnector { Openssl(actix_tls::connect::openssl::reexports::SslConnector), /// Provided because building the OpenSSL context on newer versions can be very slow. - /// This prevents unnecessary calls to `.build()` which constructing the client connector. + /// This prevents unnecessary calls to `.build()` while constructing the client connector. #[cfg(feature = "openssl")] #[allow(dead_code)] // false positive; used in build_ssl - OpensslBuilder(tls_openssl::ssl::SslConnectorBuilder), + OpensslBuilder(actix_tls::connect::openssl::reexports::SslConnectorBuilder), #[cfg(feature = "rustls")] Rustls(std::sync::Arc), @@ -77,8 +77,6 @@ impl Connector<()> { Error = actix_tls::connect::ConnectError, > + Clone, > { - println!("[awc] Connector::new"); - Connector { connector: TcpConnector::new(resolver::resolver()).service(), config: ConnectorConfig::default(), @@ -220,7 +218,6 @@ where unimplemented!("actix-http client only supports versions http/1.1 & http/2") } }; - println!("[awc] max_http_version"); self.tls = Connector::build_ssl(versions); self } @@ -308,6 +305,7 @@ where }; let tls = match self.tls { + #[cfg(feature = "openssl")] OurTlsConnector::OpensslBuilder(builder) => { OurTlsConnector::Openssl(builder.build()) } diff --git a/awc/tests/test_connector.rs b/awc/tests/test_connector.rs index 588c5146..0f0b8141 100644 --- a/awc/tests/test_connector.rs +++ b/awc/tests/test_connector.rs @@ -58,7 +58,7 @@ async fn test_connection_window_size() { .map_err(|e| log::error!("Can not set alpn protocol: {:?}", e)); let client = awc::Client::builder() - .connector(awc::Connector::new().ssl(builder.build())) + .connector(awc::Connector::new().openssl(builder.build())) .initial_window_size(100) .initial_connection_window_size(100) .finish(); diff --git a/awc/tests/test_ssl_client.rs b/awc/tests/test_ssl_client.rs index 811efd4b..40c9ab8f 100644 --- a/awc/tests/test_ssl_client.rs +++ b/awc/tests/test_ssl_client.rs @@ -72,7 +72,7 @@ async fn test_connection_reuse_h2() { .map_err(|e| log::error!("Can not set alpn protocol: {:?}", e)); let client = awc::Client::builder() - .connector(awc::Connector::new().ssl(builder.build())) + .connector(awc::Connector::new().openssl(builder.build())) .finish(); // req 1 diff --git a/tests/test_httpserver.rs b/tests/test_httpserver.rs index 887b51d4..464a650a 100644 --- a/tests/test_httpserver.rs +++ b/tests/test_httpserver.rs @@ -121,7 +121,7 @@ async fn test_start_ssl() { let client = awc::Client::builder() .connector( awc::Connector::new() - .ssl(builder.build()) + .openssl(builder.build()) .timeout(Duration::from_millis(100)), ) .finish();