Skip to content

Commit

Permalink
#374 replace awc with ureq
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Apr 9, 2022
1 parent 97cf44d commit aa57cc9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 41 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ By far most changes relate to `atomic-server`, so if not specified, assume the c
- Updated various dependencies, and made `cargo.toml` less restrictive.
- Remove `async-std` calls from `upload.rs`
- Added `reset` and `show-config` commands to `atomic-server`.
- Replaced `awc` with `ureq` #374

## [v0.31.1] - 2022-03-29

Expand Down
37 changes: 1 addition & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ actix-cors = "0.6"
actix-files = "0.6"
actix-multipart = "0.4"
actix-web-actors = "=4.0.0"
awc = "3"
chrono = "0.4"
dialoguer = "0.10"
directories = ">= 2, < 5"
Expand All @@ -40,6 +39,7 @@ tracing = "0.1"
tracing-actix-web = "0.5"
tracing-chrome = "0.5"
tracing-log = "0.1"
ureq = "2"
urlencoding = "2"

[dependencies.acme-lib]
Expand Down
10 changes: 6 additions & 4 deletions server/src/https.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ pub async fn cert_init_server(config: &crate::config::Config) -> Result<(), Erro

let handle = rx.recv().unwrap();

let client = awc::Client::new();
let agent = ureq::builder()
.timeout(std::time::Duration::from_secs(2))
.build();

let well_known_url = format!("http://{}/.well-known/", &config.opts.domain);
tracing::info!("Testing availability of {}", &well_known_url);
let resp = client
let resp = agent
.get(&well_known_url)
.send()
.await
.call()
.expect("Unable to send request for Let's Encrypt initialization");
if resp.status() != 200 {
return Err(
Expand Down

0 comments on commit aa57cc9

Please sign in to comment.