Skip to content

Commit

Permalink
allow trying the has_roots case
Browse files Browse the repository at this point in the history
even though i don't have a way to test it atm

Signed-off-by: clux <sszynrae@gmail.com>
  • Loading branch information
clux committed Nov 7, 2021
1 parent 21041b3 commit c6ad94e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kube-client/src/client/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pub mod rustls_tls {
.map_err(|e| Error::SslError(format!("{}", e)))?;
}
}
let has_roots = !roots.is_empty();

// rustls client config require a complicated series of steps through an ordered builder
// See https://docs.rs/rustls/0.20.0/rustls/struct.ConfigBuilder.html
Expand Down Expand Up @@ -143,7 +144,7 @@ pub mod rustls_tls {
cfgbld
.with_single_cert(certs, key)
.map_err(|e| Error::SslError(format!("{}", e)))?
} else if accept_invalid || true {
} else if accept_invalid || !has_roots {
let mut cfgbld = cfgbld.with_no_client_auth();
cfgbld
.dangerous()
Expand Down

0 comments on commit c6ad94e

Please sign in to comment.