Separate default-tls and native-tls features (#749)

To allow for the default-tls to change to a different backend by
default, this adds a new `native-tls` optional feature. Any TLS feature
that was only available using native-tls now requires the `native-tls`
feature to be enabled.
This commit is contained in:
Sean McArthur
2019-12-20 13:22:56 -08:00
committed by GitHub
parent 18fd9a63b0
commit 24abf2fcbd
8 changed files with 128 additions and 123 deletions

View File

@@ -1,4 +1,4 @@
#[cfg(feature = "tls")]
#[cfg(feature = "__tls")]
#[tokio::test]
async fn test_badssl_modern() {
let text = reqwest::get("https://mozilla-modern.badssl.com/")
@@ -29,7 +29,7 @@ async fn test_rustls_badssl_modern() {
assert!(text.contains("<title>mozilla-modern.badssl.com</title>"));
}
#[cfg(feature = "tls")]
#[cfg(feature = "__tls")]
#[tokio::test]
async fn test_badssl_self_signed() {
let text = reqwest::Client::builder()
@@ -47,7 +47,7 @@ async fn test_badssl_self_signed() {
assert!(text.contains("<title>self-signed.badssl.com</title>"));
}
#[cfg(feature = "default-tls")]
#[cfg(feature = "native-tls")]
#[tokio::test]
async fn test_badssl_wrong_host() {
let text = reqwest::Client::builder()