Skip to content

Commit 09f273e

Browse files
committed
enable for V3 clients
1 parent 5de9813 commit 09f273e

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

src/v3/clients.rs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,35 @@ use reqwest::{Client, ClientBuilder};
33
use crate::v3::Sender;
44

55
pub(crate) fn new_client(api_key: &str) -> Client {
6-
ClientBuilder::new()
6+
#[cfg(feature = "native-tls")]
7+
let c = ClientBuilder::new()
78
.default_headers(Sender::get_headers(api_key).unwrap_or_default())
9+
.tls_backend_native()
810
.build()
9-
.unwrap_or_default()
11+
.unwrap_or_default();
12+
13+
#[cfg(not(feature = "native-tls"))]
14+
let c = ClientBuilder::new()
15+
.default_headers(Sender::get_headers(api_key).unwrap_or_default())
16+
.build()
17+
.unwrap_or_default();
18+
c
1019
}
1120

1221
#[cfg(feature = "blocking")]
1322
pub(crate) fn new_blocking_client(api_key: &str) -> reqwest::blocking::Client {
14-
reqwest::blocking::ClientBuilder::new()
23+
#[cfg(feature = "native-tls")]
24+
let c = reqwest::blocking::ClientBuilder::new()
1525
.default_headers(Sender::get_headers(api_key).unwrap_or_default())
26+
.tls_backend_native()
1627
.build()
17-
.unwrap_or_default()
28+
.unwrap_or_default();
29+
30+
#[cfg(not(feature = "native-tls"))]
31+
let c = reqwest::blocking::ClientBuilder::new()
32+
.default_headers(Sender::get_headers(api_key).unwrap_or_default())
33+
.build()
34+
.unwrap_or_default();
35+
36+
c
1837
}

0 commit comments

Comments
 (0)