mirror of https://github.com/fafhrd91/actix-web
remove mutex features
This commit is contained in:
parent
52a28e8e68
commit
b2440ad66d
|
@ -8,7 +8,7 @@ ci-full = "check --workspace --all-features --bins --tests --examples"
|
||||||
ci-test = "test --workspace --all-features --lib --tests --no-fail-fast -- --nocapture"
|
ci-test = "test --workspace --all-features --lib --tests --no-fail-fast -- --nocapture"
|
||||||
ci-doctest = "test --workspace --all-features --doc --no-fail-fast -- --nocapture"
|
ci-doctest = "test --workspace --all-features --doc --no-fail-fast -- --nocapture"
|
||||||
|
|
||||||
|
|
||||||
ci-feature-powerset-check-no-tls="hack --workspace --feature-powerset --skip=__compress,rustls,openssl check"
|
ci-feature-powerset-check-no-tls="hack --workspace --feature-powerset --skip=__compress,rustls,openssl check"
|
||||||
ci-feature-powerset-check-rustls="hack --workspace --feature-powerset --features=rustls --skip=__compress,openssl check"
|
ci-feature-powerset-check-rustls="hack --workspace --feature-powerset --features=rustls --skip=__compress,openssl check"
|
||||||
ci-feature-powerset-check-openssl="hack --workspace --feature-powerset --features=openssl --skip=__compress,rustls check"
|
ci-feature-powerset-check-openssl="hack --workspace --feature-powerset --features=openssl --skip=__compress,rustls check"
|
||||||
|
ci-feature-powerset-check-both="hack --workspace --feature-powerset --features=rustls,openssl --skip=__compress check"
|
||||||
|
|
|
@ -115,10 +115,8 @@ jobs:
|
||||||
|
|
||||||
- name: check feature combinations
|
- name: check feature combinations
|
||||||
# if: github.ref == 'refs/heads/master'
|
# if: github.ref == 'refs/heads/master'
|
||||||
run: |
|
uses: actions-rs/cargo@v1
|
||||||
cargo ci-feature-powerset-check-no-tls
|
with: { command: ci-feature-powerset-check-both }
|
||||||
cargo ci-feature-powerset-check-openssl
|
|
||||||
cargo ci-feature-powerset-check-rustls
|
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
name: coverage
|
name: coverage
|
||||||
|
|
|
@ -68,15 +68,15 @@ __compress = []
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-codec = "0.4.0"
|
actix-codec = "0.4.0"
|
||||||
actix-macros = "0.2.3"
|
actix-macros = "0.2.3"
|
||||||
actix-router = "0.5.0-beta.2"
|
|
||||||
actix-rt = "2.2"
|
actix-rt = "2.2"
|
||||||
actix-server = "2.0.0-beta.3"
|
actix-server = "2.0.0-beta.3"
|
||||||
actix-service = "2.0.0"
|
actix-service = "2.0.0"
|
||||||
actix-utils = "3.0.0"
|
actix-utils = "3.0.0"
|
||||||
actix-tls = { version = "3.0.0-beta.7", default-features = false, optional = true }
|
actix-tls = { version = "3.0.0-beta.7", default-features = false, optional = true }
|
||||||
|
|
||||||
actix-web-codegen = "0.5.0-beta.5"
|
|
||||||
actix-http = "3.0.0-beta.11"
|
actix-http = "3.0.0-beta.11"
|
||||||
|
actix-router = "0.5.0-beta.2"
|
||||||
|
actix-web-codegen = "0.5.0-beta.5"
|
||||||
|
|
||||||
ahash = "0.7"
|
ahash = "0.7"
|
||||||
bytes = "1"
|
bytes = "1"
|
||||||
|
|
|
@ -79,14 +79,24 @@ impl Connector<()> {
|
||||||
SslConnector::None
|
SslConnector::None
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Provides an empty TLS connector when no TLS feature is enabled.
|
/// Build TLS connector with rustls, based on supplied ALPN protocols
|
||||||
#[cfg(all(feature = "openssl", feature = "rustls"))]
|
///
|
||||||
fn build_ssl(_: Vec<Vec<u8>>) -> SslConnector {
|
/// Note that if both `openssl` and `rustls` features are enabled, rustls will be used.
|
||||||
compile_error!("openssl and rustls features are mutually exclusive");
|
#[cfg(feature = "rustls")]
|
||||||
panic!("openssl and rustls features are mutually exclusive");
|
fn build_ssl(protocols: Vec<Vec<u8>>) -> SslConnector {
|
||||||
|
use actix_tls::connect::tls::rustls::{webpki_roots_cert_store, ClientConfig};
|
||||||
|
|
||||||
|
let mut config = ClientConfig::builder()
|
||||||
|
.with_safe_defaults()
|
||||||
|
.with_root_certificates(webpki_roots_cert_store())
|
||||||
|
.with_no_client_auth();
|
||||||
|
|
||||||
|
config.alpn_protocols = protocols;
|
||||||
|
|
||||||
|
SslConnector::Rustls(std::sync::Arc::new(config))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build TLS connector with openssl, based on supplied alpn protocols
|
/// Build TLS connector with openssl, based on supplied ALPN protocols
|
||||||
#[cfg(all(feature = "openssl", not(feature = "rustls")))]
|
#[cfg(all(feature = "openssl", not(feature = "rustls")))]
|
||||||
fn build_ssl(protocols: Vec<Vec<u8>>) -> SslConnector {
|
fn build_ssl(protocols: Vec<Vec<u8>>) -> SslConnector {
|
||||||
use actix_tls::connect::tls::openssl::{
|
use actix_tls::connect::tls::openssl::{
|
||||||
|
@ -107,21 +117,6 @@ impl Connector<()> {
|
||||||
|
|
||||||
SslConnector::Openssl(ssl.build())
|
SslConnector::Openssl(ssl.build())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build TLS connector with rustls, based on supplied alpn protocols
|
|
||||||
#[cfg(all(feature = "rustls", not(feature = "openssl")))]
|
|
||||||
fn build_ssl(protocols: Vec<Vec<u8>>) -> SslConnector {
|
|
||||||
use actix_tls::connect::tls::rustls::{webpki_roots_cert_store, ClientConfig};
|
|
||||||
|
|
||||||
let mut config = ClientConfig::builder()
|
|
||||||
.with_safe_defaults()
|
|
||||||
.with_root_certificates(webpki_roots_cert_store())
|
|
||||||
.with_no_client_auth();
|
|
||||||
|
|
||||||
config.alpn_protocols = protocols;
|
|
||||||
|
|
||||||
SslConnector::Rustls(std::sync::Arc::new(config))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S> Connector<S> {
|
impl<S> Connector<S> {
|
||||||
|
|
Loading…
Reference in New Issue