Skip to content

Commit

Permalink
Minor code fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ancwrd1 committed Jan 9, 2025
1 parent e601f2f commit 23ff1d2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions snxcore/src/ccc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ impl CccHttpClient {
builder = builder.danger_accept_invalid_certs(true);
}

let path = if let (true, Some(client_cert)) = (with_cert, &self.params.cert_path) {
let mut path = "/clients/";

if let (true, Some(client_cert)) = (with_cert, &self.params.cert_path) {
let data = std::fs::read(client_cert)?;
let identity = match self.params.cert_type {
CertType::Pkcs8 => Some(Identity::from_pkcs8_pem(&data, &data)?),
Expand All @@ -153,13 +155,9 @@ impl CccHttpClient {
};
if let Some(identity) = identity {
builder = builder.identity(identity);
"/clients/cert/"
} else {
"/clients/"
path = "/clients/cert/";
}
} else {
"/clients/"
};
}

let client = builder.build()?;

Expand Down

0 comments on commit 23ff1d2

Please sign in to comment.