SolarEnergy/central_backend/src/main.rs

21 lines
700 B
Rust
Raw Normal View History

2024-06-27 16:55:09 +00:00
use central_backend::app_config::AppConfig;
2024-06-28 15:21:40 +00:00
use central_backend::crypto::pki;
2024-06-27 16:55:09 +00:00
use central_backend::utils::files_utils::create_directory_if_missing;
fn main() {
2024-06-28 17:19:17 +00:00
// Initialize OpenSSL
openssl_sys::init();
2024-06-27 16:55:09 +00:00
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
// Initialize storage
2024-06-28 15:21:40 +00:00
create_directory_if_missing(AppConfig::get().pki_path()).unwrap();
2024-06-27 16:55:09 +00:00
// Initialize PKI
pki::initialize_root_ca().expect("Failed to initialize Root CA!");
2024-06-27 23:05:02 +00:00
pki::initialize_web_ca().expect("Failed to initialize web CA!");
pki::initialize_devices_ca().expect("Failed to initialize devices CA!");
2024-06-28 17:19:17 +00:00
2024-06-28 17:43:33 +00:00
pki::refresh_crls().expect("Failed to initialize Root CA!");
2024-06-27 16:55:09 +00:00
}