Add a tls_built_in_root_certs option for Client (#1150)

This commit is contained in:
Alexis Mousset
2021-01-27 15:39:36 +01:00
committed by GitHub
parent bd9ff9f371
commit 31b11c3f4c
3 changed files with 57 additions and 1 deletions

View File

@@ -59,6 +59,21 @@ async fn test_badssl_self_signed() {
assert!(text.contains("<title>self-signed.badssl.com</title>"));
}
#[cfg(feature = "__tls")]
#[tokio::test]
async fn test_badssl_no_built_in_roots() {
let result = reqwest::Client::builder()
.tls_built_in_root_certs(false)
.no_proxy()
.build()
.unwrap()
.get("https://mozilla-modern.badssl.com/")
.send()
.await;
assert!(result.is_err());
}
#[cfg(feature = "native-tls")]
#[tokio::test]
async fn test_badssl_wrong_host() {