Skip to content

Commit f10eb57

Browse files
committed
ACME: save account URL to the state directory.
We already log the URL, but on INFO level and only once. And while it is possible to find the URL from private key, the operation is not trivial. Let's make this simpler by writing a file named "account.url" to the state directory whenever the issuer tells us it created a new account. Fixes #54
1 parent b1bbe64 commit f10eb57

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/conf/issuer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ use crate::state::certificate::{CertificateContext, CertificateContextInner};
3333
use crate::state::issuer::{IssuerContext, IssuerState};
3434
use crate::time::{Time, TimeRange};
3535

36+
pub const ACCOUNT_URL_FILE: &str = "account.url";
37+
3638
const ACCOUNT_KEY_FILE: &str = "account.key";
3739
const NGX_ACME_DEFAULT_RESOLVER_TIMEOUT: ngx_msec_t = 30000;
3840
const NGX_CONF_UNSET_FLAG: ngx_flag_t = nginx_sys::NGX_CONF_UNSET as _;

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ async fn ngx_http_acme_update_certificates_for_issuer(
292292
x,
293293
issuer.name
294294
);
295+
let _ = issuer.write_state_file(conf::issuer::ACCOUNT_URL_FILE, x.as_bytes());
295296
}
296297
Ok(acme::NewAccountOutput::Found(x)) => {
297298
ngx_log_debug!(

0 commit comments

Comments
 (0)