make pbs_tools::cert not depend on pbs-buildcfg
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
//! Deals with the server's current certificates (proxy.pem).
|
||||
|
||||
use std::path::PathBuf;
|
||||
use std::mem::MaybeUninit;
|
||||
|
||||
@ -7,8 +9,6 @@ use openssl::x509::{X509, GeneralName};
|
||||
use openssl::stack::Stack;
|
||||
use openssl::pkey::{Public, PKey};
|
||||
|
||||
use pbs_buildcfg::configdir;
|
||||
|
||||
// C type:
|
||||
#[allow(non_camel_case_types)]
|
||||
type ASN1_TIME = <openssl::asn1::Asn1TimeRef as ForeignTypeRef>::CType;
|
||||
@ -40,10 +40,6 @@ fn x509name_to_string(name: &openssl::x509::X509NameRef) -> Result<String, Error
|
||||
}
|
||||
|
||||
impl CertInfo {
|
||||
pub fn new() -> Result<Self, Error> {
|
||||
Self::from_path(PathBuf::from(configdir!("/proxy.pem")))
|
||||
}
|
||||
|
||||
pub fn from_path(path: PathBuf) -> Result<Self, Error> {
|
||||
Self::from_pem(&proxmox::tools::fs::file_get_contents(&path)?)
|
||||
.map_err(|err| format_err!("failed to load certificate from {:?} - {}", path, err))
|
||||
|
Reference in New Issue
Block a user