1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-30 18:34:36 +01:00

fix after update tokio-rustls (#542)

This commit is contained in:
jeizsm 2018-10-11 11:05:07 +03:00 committed by Douman
parent ec8aef6b43
commit 32145cf6c3
2 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,11 @@
# Changes # Changes
## [0.7.13] - 2018-10-*
### Fixed
* Fixed rustls build
## [0.7.12] - 2018-10-10 ## [0.7.12] - 2018-10-10
### Changed ### Changed

View File

@ -37,15 +37,9 @@ use {
))] ))]
use { use {
rustls::ClientConfig, std::io::Error as SslError, std::sync::Arc, rustls::ClientConfig, std::io::Error as SslError, std::sync::Arc,
tokio_rustls::ClientConfigExt, webpki::DNSNameRef, webpki_roots, tokio_rustls::TlsConnector as SslConnector, webpki::DNSNameRef, webpki_roots,
}; };
#[cfg(all(
feature = "rust-tls",
not(any(feature = "alpn", feature = "tls", feature = "ssl"))
))]
type SslConnector = Arc<ClientConfig>;
#[cfg(not(any( #[cfg(not(any(
feature = "alpn", feature = "alpn",
feature = "ssl", feature = "ssl",
@ -282,7 +276,7 @@ impl Default for ClientConnector {
config config
.root_store .root_store
.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS); .add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS);
Arc::new(config) SslConnector::from(Arc::new(config))
} }
#[cfg_attr(rustfmt, rustfmt_skip)] #[cfg_attr(rustfmt, rustfmt_skip)]
@ -373,7 +367,7 @@ impl ClientConnector {
/// config /// config
/// .root_store /// .root_store
/// .add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS); /// .add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS);
/// let conn = ClientConnector::with_connector(Arc::new(config)).start(); /// let conn = ClientConnector::with_connector(config).start();
/// ///
/// conn.send( /// conn.send(
/// Connect::new("https://www.rust-lang.org").unwrap()) // <- connect to host /// Connect::new("https://www.rust-lang.org").unwrap()) // <- connect to host
@ -390,7 +384,7 @@ impl ClientConnector {
/// ``` /// ```
pub fn with_connector(connector: ClientConfig) -> ClientConnector { pub fn with_connector(connector: ClientConfig) -> ClientConnector {
// keep level of indirection for docstrings matching featureflags // keep level of indirection for docstrings matching featureflags
Self::with_connector_impl(Arc::new(connector)) Self::with_connector_impl(SslConnector::from(Arc::new(connector)))
} }
#[cfg(all( #[cfg(all(
@ -832,7 +826,7 @@ impl ClientConnector {
let host = DNSNameRef::try_from_ascii_str(&key.host).unwrap(); let host = DNSNameRef::try_from_ascii_str(&key.host).unwrap();
fut::Either::A( fut::Either::A(
act.connector act.connector
.connect_async(host, stream) .connect(host, stream)
.into_actor(act) .into_actor(act)
.then(move |res, _, _| { .then(move |res, _, _| {
match res { match res {