update to proxmox-acme 0.5

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2023-12-06 12:45:35 +01:00
parent 7fb5bd39e2
commit 92fcc4c3cd
5 changed files with 18 additions and 18 deletions

View File

@ -84,7 +84,7 @@ proxmox-uuid = "1"
# other proxmox crates
pathpatterns = "0.3"
proxmox-acme-rs = "0.4"
proxmox-acme = "0.5"
pxar = "0.10.2"
# PBS workspace
@ -227,7 +227,7 @@ proxmox-uuid.workspace = true
# in their respective repo
pathpatterns.workspace = true
proxmox-acme-rs.workspace = true
proxmox-acme.workspace = true
pxar.workspace = true
# proxmox-backup workspace/internal crates
@ -271,7 +271,7 @@ proxmox-rrd.workspace = true
#proxmox-time = { path = "../proxmox/proxmox-time" }
#proxmox-uuid = { path = "../proxmox/proxmox-uuid" }
#proxmox-acme-rs = { path = "../proxmox-acme-rs" }
#proxmox-acme = { path = "../proxmox-acme" }
#pathpatterns = {path = "../pathpatterns" }
#pxar = { path = "../pxar" }

View File

@ -10,11 +10,11 @@ use hyper::{Body, Request};
use nix::sys::stat::Mode;
use serde::{Deserialize, Serialize};
use proxmox_acme_rs::account::AccountCreator;
use proxmox_acme_rs::account::AccountData as AcmeAccountData;
use proxmox_acme_rs::order::{Order, OrderData};
use proxmox_acme_rs::Request as AcmeRequest;
use proxmox_acme_rs::{Account, Authorization, Challenge, Directory, Error, ErrorResponse};
use proxmox_acme::account::AccountCreator;
use proxmox_acme::account::AccountData as AcmeAccountData;
use proxmox_acme::order::{Order, OrderData};
use proxmox_acme::Request as AcmeRequest;
use proxmox_acme::{Account, Authorization, Challenge, Directory, Error, ErrorResponse};
use proxmox_http::client::Client;
use proxmox_sys::fs::{replace_file, CreateOptions};
@ -507,7 +507,7 @@ impl AcmeClient {
.await
.map_err(|err| Error::Custom(format!("failed to retrieve response body: {}", err)))?;
let got_nonce = if let Some(new_nonce) = parts.headers.get(proxmox_acme_rs::REPLAY_NONCE) {
let got_nonce = if let Some(new_nonce) = parts.headers.get(proxmox_acme::REPLAY_NONCE) {
let new_nonce = new_nonce.to_str().map_err(|err| {
Error::Client(format!(
"received invalid replay-nonce header from ACME server: {}",
@ -555,7 +555,7 @@ impl AcmeClient {
))
})?;
if error.ty == proxmox_acme_rs::error::BAD_NONCE {
if error.ty == proxmox_acme::error::BAD_NONCE {
if !got_nonce {
return Err(Error::InvalidApi(
"badNonce without a new Replay-Nonce header".to_string(),

View File

@ -9,7 +9,7 @@ use hyper::{Body, Request, Response};
use tokio::io::{AsyncBufReadExt, AsyncRead, AsyncWriteExt, BufReader};
use tokio::process::Command;
use proxmox_acme_rs::{Authorization, Challenge};
use proxmox_acme::{Authorization, Challenge};
use crate::acme::AcmeClient;
use crate::api2::types::AcmeDomain;

View File

@ -16,8 +16,8 @@ use proxmox_router::{
use proxmox_schema::{api, param_bail};
use proxmox_sys::{task_log, task_warn};
use proxmox_acme_rs::account::AccountData as AcmeAccountData;
use proxmox_acme_rs::Account;
use proxmox_acme::account::AccountData as AcmeAccountData;
use proxmox_acme::Account;
use pbs_api_types::{Authid, PRIV_SYS_MODIFY};

View File

@ -281,8 +281,8 @@ async fn order_certificate(
worker: Arc<WorkerTask>,
node_config: &NodeConfig,
) -> Result<Option<OrderedCertificate>, Error> {
use proxmox_acme_rs::authorization::Status;
use proxmox_acme_rs::order::Identifier;
use proxmox_acme::authorization::Status;
use proxmox_acme::order::Identifier;
let domains = node_config.acme_domains().try_fold(
Vec::<AcmeDomain>::new(),
@ -378,12 +378,12 @@ async fn order_certificate(
task_log!(worker, "All domains validated");
task_log!(worker, "Creating CSR");
let csr = proxmox_acme_rs::util::Csr::generate(&identifiers, &Default::default())?;
let csr = proxmox_acme::util::Csr::generate(&identifiers, &Default::default())?;
let mut finalize_error_cnt = 0u8;
let order_url = &order.location;
let mut order;
loop {
use proxmox_acme_rs::order::Status;
use proxmox_acme::order::Status;
order = acme.get_order(order_url).await?;
@ -453,7 +453,7 @@ async fn request_validation(
tokio::time::sleep(Duration::from_secs(5)).await;
loop {
use proxmox_acme_rs::authorization::Status;
use proxmox_acme::authorization::Status;
let auth = acme.get_authorization(auth_url).await?;
match auth.status {