MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / create_new_account

Function create_new_account

certbot/src/bot.rs:58–85  ·  view source on GitHub ↗
(
    config: &CertBotConfig,
    dns01_client: Dns01Client,
)

Source from the content-addressed store, hash-verified

56}
57
58async fn create_new_account(
59 config: &CertBotConfig,
60 dns01_client: Dns01Client,
61) -> Result<AcmeClient> {
62 info!("creating new ACME account");
63 let client = AcmeClient::new_account(
64 &config.acme_url,
65 dns01_client,
66 config.max_dns_wait,
67 config.dns_txt_ttl,
68 )
69 .await
70 .context("failed to create new account")?;
71 let credentials = client
72 .dump_credentials()
73 .context("failed to dump credentials")?;
74 info!("created new ACME account: {}", client.account_id());
75 if config.auto_set_caa {
76 client
77 .set_caa_records(&config.cert_subject_alt_names)
78 .await?;
79 }
80 if let Some(credential_dir) = config.credentials_file.parent() {
81 fs::create_dir_all(credential_dir).context("failed to create credential directory")?;
82 }
83 fs::write(&config.credentials_file, credentials).context("failed to write credentials")?;
84 Ok(client)
85}
86
87impl CertBot {
88 /// Build a new `CertBot` from a `CertBotConfig`.

Callers 1

buildMethod · 0.85

Calls 2

dump_credentialsMethod · 0.80
set_caa_recordsMethod · 0.80

Tested by

no test coverage detected