Skip to content

Commit

Permalink
add mtls support (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
notoriaga authored Mar 13, 2024
1 parent 7e86b80 commit 6687cd7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ struct Cli {
/// Request that no ephemeris is sent on connection
#[arg(long)]
no_eph: bool,

/// Client certificate file for mTLS
#[arg(long, requires = "key")]
cert: Option<PathBuf>,

/// Private key file for mTLS
#[arg(long, requires = "cert")]
key: Option<PathBuf>,
}

#[derive(Debug, Clone, Copy, serde::Deserialize)]
Expand Down Expand Up @@ -315,6 +323,11 @@ fn run() -> Result<()> {
curl.http_version(HttpVersion::Any)?;
curl.http_09_allowed(true)?;

if let (Some(cert), Some(key)) = (&opt.cert, &opt.key) {
curl.ssl_cert(cert)?;
curl.ssl_key(key)?;
}

if opt.verbose || opt.debug {
curl.verbose(true)?;
}
Expand Down

0 comments on commit 6687cd7

Please sign in to comment.