Skip to content

Commit

Permalink
feat: Allow use of system default TLS trusted root by omitting the tr…
Browse files Browse the repository at this point in the history
…usted_root client config parameter. (rapiz1#192)
  • Loading branch information
neumark authored Sep 14, 2022
1 parent 064bdca commit 187f4f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,6 @@ impl Config {
.as_ref()
.and(tls_config.pkcs12_password.as_ref())
.ok_or_else(|| anyhow!("Missing `pkcs12` or `pkcs12_password`"))?;
} else {
tls_config
.trusted_root
.as_ref()
.ok_or_else(|| anyhow!("Missing `trusted_root`"))?;
}
Ok(())
}
Expand Down
6 changes: 5 additions & 1 deletion src/transport/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ impl Transport for TlsTransport {
.build()?;
Some(TlsConnector::from(connector))
}
None => None,
None => {
// if no trusted_root is specified, allow TlsConnector to use system default
let connector = native_tls::TlsConnector::builder().build()?;
Some(TlsConnector::from(connector))
},
};

let tls_acceptor = match config.pkcs12.as_ref() {
Expand Down

0 comments on commit 187f4f0

Please sign in to comment.