-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.rs
More file actions
57 lines (42 loc) · 2.16 KB
/
config.rs
File metadata and controls
57 lines (42 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use std::path::PathBuf;
use structopt::StructOpt;
/// A StructOpt example
#[derive(StructOpt, Debug)]
#[structopt()]
#[rustfmt::skip]
pub(crate) struct Opt {
/// Silence all output
#[structopt(short = "q", long = "quiet")]
pub(crate) quiet: bool,
/// Verbose mode (-v, -vv, -vvv, etc)
#[structopt(short = "v", long = "verbose", parse(from_occurrences), help = "Increase logging to DEBUG (-v) or TRACE (-vv) level")]
pub(crate) verbose: usize,
/// HSM host/domain name
#[structopt(short = "h", long = "host", default_value = "localhost")]
pub(crate) host: String,
/// HSM port number
#[structopt(short = "p", long = "port", default_value = "5696")]
pub(crate) port: u16,
/// HSM username
#[structopt(short = "u", long = "user", help = "Specify an optional password in env var HSM_PASSWORD")]
pub(crate) username: Option<String>,
#[structopt(short = "i", long = "insecure", help = "Disable verification of the server certificate")]
pub(crate) insecure: bool,
#[structopt(long = "client-cert", parse(from_os_str), help = "Path to the client certificate file in PEM format")]
pub(crate) client_cert_path: Option<PathBuf>,
#[structopt(long = "client-key", parse(from_os_str), help = "Path to the client certificate key file in PEM format")]
pub(crate) client_key_path: Option<PathBuf>,
#[structopt(long = "client-cert-and-key", parse(from_os_str), help = "Path to the client certificate and key file in PKCS#12 format")]
pub(crate) client_pkcs12_path: Option<PathBuf>,
#[structopt(long = "server-cert", parse(from_os_str), help = "Path to the server certificate file in PEM format")]
pub(crate) server_cert_path: Option<PathBuf>,
#[structopt(long = "ca-cert", parse(from_os_str), help = "Path to the CA certificate file in PEM format")]
pub(crate) ca_cert_path: Option<PathBuf>,
/// TCP timeouts
#[structopt(long = "connect-timeout", default_value = "5")]
pub(crate) connect_timeout: u64,
#[structopt(long = "read-timeout", default_value = "5")]
pub(crate) read_timeout: u64,
#[structopt(long = "write-timeout", default_value = "5")]
pub(crate) write_timeout: u64,
}