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

Function extract_certificate

certbot/src/acme_client.rs:547–564  ·  view source on GitHub ↗
(mut order: Order)

Source from the content-addressed store, hash-verified

545}
546
547async fn extract_certificate(mut order: Order) -> Result<String> {
548 let mut tries = 0;
549 let cert_chain_pem = loop {
550 tries += 1;
551 if tries > 5 {
552 bail!("failed to get certificate");
553 }
554 match order
555 .certificate()
556 .await
557 .context("failed to get certificate")?
558 {
559 Some(cert_chain_pem) => break cert_chain_pem,
560 None => sleep(Duration::from_secs(1)).await,
561 }
562 };
563 Ok(cert_chain_pem)
564}
565
566fn need_renew(cert_pem: &str, expires_in: Duration) -> Result<bool> {
567 let pem = read_pem(cert_pem)?;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected