aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 6eeafef..66cd81a 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -7,6 +7,13 @@ use std::{
use anyhow::{anyhow, Context, Result};
use http::HeaderMap;
+
+#[cfg(any(
+ target_arch = "x86",
+ target_arch = "x86_64",
+ target_arch = "aarch64",
+ target_arch = "arm"
+))]
use rustls::internal::pemfile::{certs, pkcs8_private_keys};
use crate::{args::CliArgs, auth::RequiredAuth};
@@ -95,7 +102,21 @@ pub struct MiniserveConfig {
pub hide_version_footer: bool,
/// If set, use provided rustls config for TLS
+ #[cfg(any(
+ target_arch = "x86",
+ target_arch = "x86_64",
+ target_arch = "aarch64",
+ target_arch = "arm"
+ ))]
pub tls_rustls_config: Option<rustls::ServerConfig>,
+
+ #[cfg(not(any(
+ target_arch = "x86",
+ target_arch = "x86_64",
+ target_arch = "aarch64",
+ target_arch = "arm"
+ )))]
+ pub tls_rustls_config: Option<()>,
}
impl MiniserveConfig {
@@ -131,6 +152,12 @@ impl MiniserveConfig {
_ => args.port,
};
+ #[cfg(any(
+ target_arch = "x86",
+ target_arch = "x86_64",
+ target_arch = "aarch64",
+ target_arch = "arm"
+ ))]
let tls_rustls_server_config = if let (Some(tls_cert), Some(tls_key)) =
(args.tls_cert, args.tls_key)
{
@@ -150,6 +177,15 @@ impl MiniserveConfig {
} else {
None
};
+
+ #[cfg(not(any(
+ target_arch = "x86",
+ target_arch = "x86_64",
+ target_arch = "aarch64",
+ target_arch = "arm"
+ )))]
+ let tls_rustls_server_config = None;
+
Ok(MiniserveConfig {
verbose: args.verbose,
path: args.path.unwrap_or_else(|| PathBuf::from(".")),