Skip to content

Commit f1ca91a

Browse files
committed
Use aws_lc_rs as default crypto backend
1 parent 9618329 commit f1ca91a

2 files changed

Lines changed: 17 additions & 19 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ resolver = "2"
1515
[dependencies]
1616
reqwest = { version = "0.13", default-features = false, features = ["rustls", "http2"] }
1717
tokio-tungstenite = { version = "0.29", features = ["rustls-tls-native-roots"], optional = true}
18-
tokio = { version = "1.47", default-features = false, features = ["io-util"], optional = true }
18+
tokio = { version = "1.51", default-features = false, features = ["io-util"], optional = true }
1919
futures-util = { version = "0.3", optional = true}
2020
async-stream = { version = "0.3", optional = true}
2121
rustls = { version = "0.23", optional = true, default-features = false, features = ["std"]}
@@ -29,7 +29,7 @@ base64 = "0.22"
2929
maybe-async = "0.2"
3030

3131
[features]
32-
default = ["async", "websockets", "ring"]
32+
default = ["async", "websockets", "aws_lc_rs"]
3333
async = ["futures-util", "async-stream", "reqwest/stream"]
3434
websockets = ["tokio", "tokio-tungstenite", "rustls"]
3535
blocking = ["reqwest/blocking", "maybe-async/is_sync"]

src/client.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
* except according to those terms.
1010
*/
1111

12-
use std::{
13-
net::IpAddr,
14-
sync::{
15-
atomic::{AtomicBool, Ordering},
16-
Arc,
12+
use crate::{
13+
blob,
14+
core::{
15+
request::{self, Request},
16+
response,
17+
session::{Session, URLPart},
1718
},
18-
time::Duration,
19+
Error,
1920
};
20-
2121
use ahash::AHashSet;
22+
use base64::{engine::general_purpose, Engine};
2223
#[cfg(feature = "blocking")]
2324
use reqwest::blocking::{Client as HttpClient, Response};
2425
use reqwest::{
@@ -27,17 +28,14 @@ use reqwest::{
2728
};
2829
#[cfg(feature = "async")]
2930
use reqwest::{Client as HttpClient, Response};
30-
3131
use serde::de::DeserializeOwned;
32-
33-
use crate::{
34-
blob,
35-
core::{
36-
request::{self, Request},
37-
response,
38-
session::{Session, URLPart},
32+
use std::{
33+
net::IpAddr,
34+
sync::{
35+
atomic::{AtomicBool, Ordering},
36+
Arc,
3937
},
40-
Error,
38+
time::Duration,
4139
};
4240

4341
const DEFAULT_TIMEOUT_MS: u64 = 10 * 1000;
@@ -432,7 +430,7 @@ impl Client {
432430

433431
impl Credentials {
434432
pub fn basic(username: &str, password: &str) -> Self {
435-
Credentials::Basic(base64::encode(format!("{}:{}", username, password)))
433+
Credentials::Basic(general_purpose::STANDARD.encode(format!("{}:{}", username, password)))
436434
}
437435

438436
pub fn bearer(token: impl Into<String>) -> Self {

0 commit comments

Comments
 (0)