use utility_pki::profiles::{self, ALL};
fn main() {
let id = std::env::args().nth(1).unwrap_or_else(|| "bdew-as4".into());
let Some(profile) = profiles::by_id(&id) else {
let ids: Vec<&str> = ALL.iter().map(|p| p.id).collect();
eprintln!("unknown profile {id}; choose one of: {}", ids.join(", "));
std::process::exit(2);
};
match profile.openssl() {
Ok(config) => {
println!("# Paste into the section your ssl_conf points to, for example:");
println!("# openssl_conf = openssl_init");
println!("# [openssl_init] ssl_conf = ssl_sect");
println!("# [ssl_sect] system_default = tls_profile");
println!("# [tls_profile]");
print!("{config}");
}
Err(e) => {
eprintln!("{id}: {e}");
std::process::exit(1);
}
}
}