feat: log
This commit is contained in:
@@ -97,8 +97,11 @@ impl CertConfig {
|
||||
if x509_certificate.certificate_not_after >= (valid_days_secs + secs_from_unix_epoch) {
|
||||
information!("Certificate: {} is valid: {} days", item.path,
|
||||
(x509_certificate.certificate_not_after - secs_from_unix_epoch)/valid_days_secs
|
||||
)
|
||||
);
|
||||
} else {
|
||||
warning!("Certificate: {} is valid: {} days", item.path,
|
||||
(x509_certificate.certificate_not_after - secs_from_unix_epoch)/valid_days_secs
|
||||
);
|
||||
cert_items.push(item2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,11 +237,12 @@ fn request_domains(acme_request: AcmeRequest) -> XResult<()> {
|
||||
let ord_cert = opt_result!( ord_csr.finalize_pkey(pkey_pri, acme_request.timeout), "Submit CSR failed: {}");
|
||||
let cert = opt_result!( ord_cert.download_and_save_cert(), "Download and save certificate failed: {}");
|
||||
|
||||
|
||||
if let (Some(cert_file), Some(key_file)) = (&acme_request.cert_file, &acme_request.key_file) {
|
||||
information!("Write file: {}", cert_file);
|
||||
if let Err(e) = fs::write(cert_file, cert.certificate()) {
|
||||
failure!("Write file: {}, failed: {}", cert_file, e);
|
||||
}
|
||||
information!("Write file: {}", key_file);
|
||||
if let Err(e) = fs::write(key_file, cert.private_key()) {
|
||||
failure!("Write file: {}, failed: {}", key_file, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user