mirror of
https://github.com/htrefil/rkvm.git
synced 2025-01-18 10:26:12 +01:00
Use optional OPENSSL environmental variable
This commit is contained in:
parent
3b9f15f529
commit
8f1037f598
1 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
use anyhow::{Context, Error};
|
||||
use std::env;
|
||||
use std::fmt::Write as _;
|
||||
use std::io::Write;
|
||||
use std::net::IpAddr;
|
||||
|
@ -52,7 +53,8 @@ subjectAltName = @alt_names
|
|||
file.write_all(config.as_bytes())
|
||||
.context("Failed to write to config file")?;
|
||||
|
||||
let code = Command::new("openssl")
|
||||
let openssl = env::var_os("OPENSSL").unwrap_or_else(|| "openssl".to_owned().into());
|
||||
let code = Command::new(&openssl)
|
||||
.arg("req")
|
||||
.arg("-sha256")
|
||||
.arg("-x509")
|
||||
|
@ -75,7 +77,7 @@ subjectAltName = @alt_names
|
|||
return Err(anyhow::anyhow!("OpenSSL exited unsuccessfully"));
|
||||
}
|
||||
|
||||
let code = Command::new("openssl")
|
||||
let code = Command::new(&openssl)
|
||||
.arg("pkcs12")
|
||||
.arg("-export")
|
||||
.arg("-out")
|
||||
|
|
Loading…
Reference in a new issue