chore: log

This commit is contained in:
2021-05-01 08:19:57 +08:00
parent 6819d49abf
commit e99f077494
3 changed files with 8 additions and 6 deletions

View File

@@ -125,12 +125,13 @@ fn request_domains(contract_email: &str, primary_name: &str, alt_names: &[&str],
let mut order_csr_index = 0;
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() {
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: {}");
for auth in &auths {
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());
}
};
let peer = req.peer_addr().unwrap_or("none");
let auth_token = { TOKEN_MAP.read().unwrap().get(token).cloned() };
match 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)
}
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())
}
}