chore: log
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -2,7 +2,7 @@
|
|||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "acme-client"
|
name = "acme-client"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"acme-lib",
|
"acme-lib",
|
||||||
"async-std",
|
"async-std",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "acme-client"
|
name = "acme-client"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "Acme auto challenge client, acme-client can issue certificates from Let's encrypt"
|
description = "Acme auto challenge client, acme-client can issue certificates from Let's encrypt"
|
||||||
|
|||||||
10
src/main.rs
10
src/main.rs
@@ -125,12 +125,13 @@ fn request_domains(contract_email: &str, primary_name: &str, alt_names: &[&str],
|
|||||||
|
|
||||||
let mut order_csr_index = 0;
|
let mut order_csr_index = 0;
|
||||||
let ord_csr = loop {
|
let ord_csr = loop {
|
||||||
information!("Loop for acme challenge auth, #{}", order_csr_index);
|
|
||||||
order_csr_index += 1;
|
|
||||||
if let Some(ord_csr) = ord_new.confirm_validations() {
|
if let Some(ord_csr) = ord_new.confirm_validations() {
|
||||||
break ord_csr;
|
break ord_csr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
information!("Loop for acme challenge auth, #{}", order_csr_index);
|
||||||
|
order_csr_index += 1;
|
||||||
|
|
||||||
let auths = opt_result!(ord_new.authorizations(), "Order auth failed: {}");
|
let auths = opt_result!(ord_new.authorizations(), "Order auth failed: {}");
|
||||||
for auth in &auths {
|
for auth in &auths {
|
||||||
let chall = auth.http_challenge();
|
let chall = auth.http_challenge();
|
||||||
@@ -176,14 +177,15 @@ fn startup_http_server(s: Sender<i32>, port: u16) {
|
|||||||
return Ok("400 - bad request".to_string());
|
return Ok("400 - bad request".to_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
let peer = req.peer_addr().unwrap_or("none");
|
||||||
let auth_token = { TOKEN_MAP.read().unwrap().get(token).cloned() };
|
let auth_token = { TOKEN_MAP.read().unwrap().get(token).cloned() };
|
||||||
match auth_token {
|
match auth_token {
|
||||||
Some(auth_token) => {
|
Some(auth_token) => {
|
||||||
information!("Request acme challenge: {} -> {}, peer: {:?}", token, auth_token, req.peer_addr());
|
information!("Request acme challenge: {} -> {}, peer: {:?}", token, auth_token, peer);
|
||||||
Ok(auth_token)
|
Ok(auth_token)
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
warning!("Request acme challenge not found: {}, peer: {:?}", token, req.peer_addr());
|
warning!("Request acme challenge not found: {}, peer: {:?}", token, peer);
|
||||||
Ok("404 - not found".to_string())
|
Ok("404 - not found".to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user